App Svelte Component
App Svelte component is the main Framework7 app component where all the Framework7 core initialization happens and where you pass all main Framework7 parameters.
App Components
There are following components included:
App
App Properties
Prop | Type | Default | Description |
---|---|---|---|
params | object | Object with Framework7 parameters | |
routes | array | Array with default routes for all views. Same as params.routes so you can use this one if you feel more comfortable with such approach | |
id | string | App element ID attribute |
Examples
Passing all parameters in params
prop
<App params={f7params}>
...
</App>
<script>
import { App } from 'framework7-svelte';
import AboutPage from './about.svelte';
import ServicesPage from './services.svelte';
const f7params = {
name: 'My App',
id: 'com.myapp.test',
// routes
routes: [
{
path: '/about/',
component: AboutPage,
},
{
path: '/services/',
component: ServicesPage,
},
],
// ... other params
}
</script>
Passing routes in separate prop:
<App params={f7params} routes={routes}>
...
</App>
<script>
import { App } from 'framework7-svelte';
import routes from './routes';
const f7params = {
name: 'My App',
id: 'com.myapp.test',
// ... other params
};
</script>
当前内容版权归 Framework7 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Framework7 .