Created
December 31, 2020 11:45
-
-
Save nolimits4web/d1ab619b7bdeee7dffa0ba32d7f72a67 to your computer and use it in GitHub Desktop.
Framework7 v6 Router 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
<template> | |
<div class="page"> | |
<p>Value is: ${foo}</p> | |
<p> | |
<a href="#" @click=${changeValue}>Change value</a> | |
</p> | |
<ul> | |
${items.map((item) => $h` | |
<li>${item.title}</li> | |
`)} | |
</ul> | |
</div> | |
</template> | |
<script> | |
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 $render; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment