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"> | |
<ul> | |
<!-- getter has value in ".value" property --> | |
${users.value.map((user) => $h` | |
<li>${user.name}</li> | |
`)} | |
</ul> | |
</div> | |
</template> |
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
import Framework7 from 'framework7'; | |
import store from 'path/to/store.js'; | |
const app = new Framework7({ | |
// pass store instance | |
store, | |
// ... | |
}) |
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
import { createStore } from 'framework7'; | |
// create store | |
const store = createStore({ | |
// start with the state (store data) | |
state: { | |
users: [], | |
// ... | |
}, |
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' | |
}, | |
]; |
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> | |
`)} |
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> | |
{{each items}} | |
<li>{{title}}</li> | |
{{/each}} |
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
<App { params }> | |
<View main url="/" /> | |
</App> | |
<script> | |
import { App, View } from 'framework7-svelte'; | |
import Home from './pages/home.svelte'; | |
const params = { | |
// ... |
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
<App> | |
<Panel left cover swipe visibleBreakpoint={768}>...</Panel> | |
<Panel right cover visibleBreakpoint={1024}>...</Panel> | |
... | |
</App> |
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
<div class="list"> | |
<ul> | |
<my-list-item id="item-1"></my-list-item> | |
</ul> | |
</div> |
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
import { Component } from 'famework7'; | |
export default class extends Component { | |
data() { | |
return { foo: 'bar' } | |
} | |
mounted() { | |
console.log('mounted'); | |
this.onMounted(); // call method | |
} |