Svelte Component Extensions

    In addition to Framework7 Svelte components there are some useful props and methods we can import from :

    If you need other useful Framework7 utils you can import them directly from Framework7 core library:

    Device utilities
    RequestRequest library for XHR requests
    Utils object with few useful utilities

    For example

    1. <Page>
    2. <List>
    3. <ListItem title="Toggle">
    4. <!-- wrap with extra element -->
    5. </span>
    6. </ListItem>
    7. </List>
    8. </Page>

    All Framework7 Svelte components support events. But the way how Svelte handles events (by emitting CustomEvent) can be inconvenient when we need to get event arguments (via event.detail) and especially when there are few arguments.

    To workaround this, all Framework7 Svelte component events has same `on${Event}` prop callback:

    1. <Page onPageInit={onPageInit}>
    2. <!-- -->
    3. </Page>
    4. <script>
    5. // pageInit event has one argument with page data
    6. function onPageInit(pageData) {
    7. console.log(pageData);
    8. </script>

    ← Initialize App