Initialize App

    After we have our app layout now we need to mount Vue components and initialize the app. You can read about all possible Framework7 initialization parameters in appropriate Framework7 App Parameters section.

    Assuming you use Webpack, Rollup or another bundler with ES-next modules support, we may have the following structure:

    <!-- index.html -->
    <!DOCTYPE html>
        <!-- ... metas and styles ... -->
        <link rel="stylesheet" href="path/to/framework7-bundle.min.css">
        <!-- App Root Element -->
        <div id="app"></div>
        <!-- Scripts will be auto injected -->
    /* my-app.js */
    import { createApp } from 'vue'
    // Import F7 Bundle
    import Framework7 from 'framework7/lite-bundle'
    // Import F7-Vue Plugin Bundle (with all F7 components registered)
    import Framework7Vue, { registerComponents } from 'framework7-vue/bundle'
    // Init F7-Vue Plugin
    // Import Main App component
    import App from './app.vue';
    // Init App
    const app = createApp(App);
    // Register all Framework7 Vue components
    // Mounte Vue App
    <!-- app.vue -->
      <!-- Main Framework7 App component where we pass Framework7 params -->
      <f7-app v-bind="f7params">
        <!-- initial page is specified in routes.js -->
        <f7-view main url="/"></f7-view>
      import routes from './routes.js';
      export default {
        data() {
          return {
            // Framework7 parameters that we pass to <f7-app> component
            f7params: {
              // Array with app routes
              // App Name
              name: 'My App',
              // App id
              id: 'com.myapp.test',
              // ...

    In the examples above:

    • we pass Framework7 parameters to the f7-app main Framework7 app component in its properties;
    • root element passed to Vue's createApp will be used as Framework7 root element

    We also must specify array with routes (if we have navigation between pages in the app). Check out information about Vue Component Extensions, router and routes in the Navigation Router section.