Created
December 31, 2020 11:49
-
-
Save nolimits4web/14eb293779d2568c99237e1c73d9f120 to your computer and use it in GitHub Desktop.
Framework7 v6 JSX Component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (props, { $f7, $on, $update }) => { | |
let foo = 'bar'; | |
const items = [ | |
{ | |
title: 'Item 1' | |
}, | |
{ | |
title: 'Item 2' | |
}, | |
]; | |
const changeValue = () => { | |
foo = 'bar 2'; | |
$update(); | |
} | |
$on('pageInit', () => { | |
$f7.dialog.alert('page init') | |
}) | |
return () => ( | |
<div class="page"> | |
<p>Value is: {foo}</p> | |
<p> | |
<a href="#" onClick={changeValue}>Change value</a> | |
</p> | |
<ul> | |
{items.map((item) => ( | |
<li>{item.title}</li> | |
))} | |
</ul> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment