|
1 | 1 | <template>
|
2 | 2 | <v-app light>
|
3 | 3 | <v-navigation-drawer
|
4 |
| - persistent |
| 4 | + fixed |
5 | 5 | :mini-variant="miniVariant"
|
6 | 6 | :clipped="clipped"
|
7 | 7 | v-model="drawer"
|
8 |
| - enable-resize-watcher |
| 8 | + app |
9 | 9 | >
|
10 | 10 | <v-list>
|
11 | 11 | <v-list-tile
|
12 | 12 | value="true"
|
13 | 13 | v-for="(item, i) in items"
|
14 | 14 | :key="i"
|
| 15 | + exact |
15 | 16 | >
|
16 | 17 | <v-list-tile-action>
|
17 | 18 | <v-icon light v-html="item.icon"></v-icon>
|
|
22 | 23 | </v-list-tile>
|
23 | 24 | </v-list>
|
24 | 25 | </v-navigation-drawer>
|
25 |
| - <v-toolbar fixed> |
| 26 | + <v-toolbar fixed app :clipped-left="clipped"> |
26 | 27 | <v-toolbar-side-icon @click.stop="drawer = !drawer" light></v-toolbar-side-icon>
|
27 | 28 | <v-btn
|
28 | 29 | icon
|
|
55 | 56 | <v-icon>menu</v-icon>
|
56 | 57 | </v-btn>
|
57 | 58 | </v-toolbar>
|
58 |
| - <main> |
59 |
| - <v-container fluid> |
60 |
| - <v-slide-y-transition mode="out-in"> |
61 |
| - <v-layout column align-center> |
62 |
| - <img src="/static/img/v.png" alt="Vuetify.js" class="mb-5"> |
63 |
| - <blockquote> |
64 |
| - “First, solve the problem. Then, write the code.” |
65 |
| - <footer> |
66 |
| - <small> |
67 |
| - <em>—John Johnson</em> |
68 |
| - </small> |
69 |
| - </footer> |
70 |
| - </blockquote> |
71 |
| - </v-layout> |
72 |
| - </v-slide-y-transition> |
73 |
| - </v-container> |
74 |
| - </main> |
| 59 | + <v-content> |
| 60 | + {{#router}} |
| 61 | + <router-view></router-view> |
| 62 | + {{else}} |
| 63 | + <hello></hello> |
| 64 | + {{/router}} |
| 65 | + </v-content> |
75 | 66 | <v-navigation-drawer
|
76 | 67 | temporary
|
77 | 68 | :right="right"
|
78 | 69 | v-model="rightDrawer"
|
| 70 | + fixed |
79 | 71 | >
|
80 | 72 | <v-list>
|
81 | 73 | <v-list-tile @click="right = !right">
|
|
86 | 78 | </v-list-tile>
|
87 | 79 | </v-list>
|
88 | 80 | </v-navigation-drawer>
|
89 |
| - <v-footer :fixed="fixed"> |
90 |
| - <span>© 2017</span> |
91 |
| - </v-footer> |
92 | 81 | </v-app>
|
93 | 82 | </template>
|
94 | 83 |
|
95 | 84 | <script>
|
| 85 | + {{#unless router}} |
| 86 | + import Hello from '@/components/Hello'{{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 87 | + {{/unless}} |
| 88 | + import Vue from 'vue'{{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
96 | 89 | export default {
|
97 |
| - data () { |
| 90 | + data{{#unless_eq lintConfig "airbnb"}} {{/unless_eq}}() { |
98 | 91 | return {
|
| 92 | + cordova: Vue.cordova, |
99 | 93 | clipped: false,
|
100 | 94 | drawer: true,
|
101 | 95 | fixed: false,
|
102 |
| - items: [ |
103 |
| - { icon: 'bubble_chart', title: 'Inspire' } |
104 |
| - ], |
| 96 | + items: [{ |
| 97 | + icon: 'bubble_chart', |
| 98 | + title: 'Inspire'{{#if_eq lintConfig "airbnb"}},{{/if_eq}} |
| 99 | + }], |
105 | 100 | miniVariant: false,
|
106 | 101 | right: true,
|
107 | 102 | rightDrawer: false,
|
108 |
| - title: 'Vuetify.js' |
| 103 | + title: 'Vuetify.js'{{#if_eq lintConfig "airbnb"}},{{/if_eq}} |
| 104 | + }{{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 105 | + }{{#unless router}}, |
| 106 | + components: { |
| 107 | + Hello{{#if_eq lintConfig "airbnb"}},{{/if_eq}} |
| 108 | + }{{/unless}}, |
| 109 | + created () { |
| 110 | + var self = this{{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 111 | + this.cordova.on('deviceready', () => { |
| 112 | + self.onDeviceReady(){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 113 | + }){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 114 | + }, |
| 115 | + methods: { |
| 116 | + onDeviceReady: function () { |
| 117 | + // Handle the device ready event. |
| 118 | + this.cordova.on('pause', this.onPause, false){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 119 | + this.cordova.on('resume', this.onResume, false){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 120 | + if (this.cordova.device.platform === 'Android') { |
| 121 | + document.addEventListener('backbutton', this.onBackKeyDown, false){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 122 | + }{{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 123 | + }, |
| 124 | + onPause () { |
| 125 | + // Handle the pause lifecycle event. |
| 126 | + console.log('pause'){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 127 | + }, |
| 128 | + onResume () { |
| 129 | + // Handle the resume lifecycle event. |
| 130 | + // SetTimeout required for iOS. |
| 131 | + setTimeout(function () { |
| 132 | + console.log('resume'){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 133 | + }, 0){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
| 134 | + }, |
| 135 | + onBackKeyDown () { |
| 136 | + // Handle the back-button event on Android. By default it will exit the app. |
| 137 | + navigator.app.exitApp(){{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
109 | 138 | }
|
110 |
| - } |
111 |
| - } |
| 139 | + }{{#if_eq lintConfig "airbnb"}},{{/if_eq}} |
| 140 | + }{{#if_eq lintConfig "airbnb"}};{{/if_eq}} |
112 | 141 | </script>
|
113 |
| - |
114 |
| -<style lang="stylus"> |
115 |
| - @import './stylus/main' |
116 |
| -</style> |
|
0 commit comments