F7-V4 + Vue Starter

by Maiki Nahara

HTML

<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/framework7/4.2.2/css/framework7.bundle.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/framework7/4.2.2/js/framework7.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/framework7-vue.bundle.min.js"></script>
<div id="app">
  <f7-app :params="f7params">
    <f7-statusbar></f7-statusbar>

    <!-- Main View -->
    <f7-view id="main-view" main class="safe-areas">
      <f7-page>
        <f7-navbar>
          <f7-nav-left>
            <f7-link icon-if-ios="f7:menu" icon-if-md="material:menu" panel-open="left"></f7-link>
          </f7-nav-left>
          <f7-nav-title>My App</f7-nav-title>
          <f7-nav-right>
            <f7-link icon-if-ios="f7:menu" icon-if-md="material:menu" panel-open="right"></f7-link>
          </f7-nav-right>
        </f7-navbar>
        <f7-list>
          <f7-list-item link="/swipe-wizzard/" title="Swipe Wizzard"></f7-list-item>
        </f7-list>
      </f7-page>
    </f7-view>
  </f7-app>
</div>

<!-- Page 1 Template -->
<template id="swipeWizzard">
  <f7-page>
    <f7-navbar title="Swipe Wizzard" back-link="Back"></f7-navbar>
  </f7-page>
</template>


<!-- Page Not Found Template -->
<template id="page-not-found">
    <f7-page>
      <f7-navbar title="Not found" back-link="Back"></f7-navbar>
      <f7-block strong>
        <p>Sorry</p>
        <p>Requested content not found.</p>
      </f7-block>
    </f7-page>
  </template>

JavaScript

// Init F7 Vue Plugin
Framework7.use(Framework7Vue);

// Init Page Components
Vue.component('Swipe Wizzard', {
  template: '#Swipe Wizzard',
  created () {
  },
  methods: {
  testTabMnt (a,s,d) {
  		debugger
  	}
  }
});

Vue.component('page-not-found', {
  template: '#page-not-found'
});

// Init App
new Vue({
  el: '#app',
  data: function() {
    return {
      f7params: {
        root: '#app',
        id: 'io.framework7.testapp',
        name: 'Framework7',
        theme: 'ios',
        view: {
          stackPages: false,
          allowDuplicateUrls: false
        },
        routes: [{
            path: '/swipe-wizzard/',
            component: 'swipeWizzard'
          },
          {
            path: '/page2/',
            component: 'page2'
          },
          {
            path: '(.*)',
            component: 'page-not-found',
          },
        ],
      }
    }
  },
});