Skip to content

Instantly share code, notes, and snippets.

@nolimits4web
Created December 31, 2020 11:45
Show Gist options
  • Save nolimits4web/d1ab619b7bdeee7dffa0ba32d7f72a67 to your computer and use it in GitHub Desktop.
Save nolimits4web/d1ab619b7bdeee7dffa0ba32d7f72a67 to your computer and use it in GitHub Desktop.
Framework7 v6 Router Component
<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