This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'nativescript-vue' | |
import App from './components/App' | |
// Prints Vue logs when --env.production is *NOT* set while building | |
Vue.config.silent = (TNS_ENV === 'production') | |
Vue.registerElement('RadSideDrawer', () => require('nativescript-ui-sidedrawer').RadSideDrawer) | |
new Vue({ | |
render: h => h('frame', [h(App)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Home from '~/pages/Home' | |
import PageOne from '~/pages/PageOne' | |
import PageTwo from '~/pages/PageTwo' | |
const routes = { | |
Home, | |
PageOne, | |
PageTwo | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<Page> | |
<ActionBar> | |
<GridLayout width="100%" columns="auto, *"> | |
<Label text="MENU" @tap="openDrawer()" col="0"/> | |
<Label class="title" text="Welcome to NativeScript-Vue!" col="1"/> | |
</GridLayout> | |
</ActionBar> | |
<GridLayout ~mainContent columns="*" rows="*"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
data () { | |
return { | |
// we'll use this to enable gestures on our sideDrawer. | |
gesturesEnabled: false | |
} | |
}, | |
computed: { | |
// drawerElement points to the drawer node using vue $refs | |
drawerElement () { return (this.$refs && this.$refs.drawer) || null }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'nativescript-vue' | |
import Vuex from 'vuex' | |
import sideDrawer from './modules/sideDrawer' | |
Vue.use(Vuex) | |
let debug = process.env.NODE_ENV !== 'production' | |
let store = new Vuex.Store({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const state = { | |
// this toggles the sidedrawer | |
sideDrawer: false | |
} | |
const mutations = { | |
// always and only change vuex state through mutations. | |
setSideDrawer (state, data) { | |
state.sideDrawer = data | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<RadSideDrawer ref="drawer" drawerLocation="Left" :gesturesEnabled="gesturesEnabled"> | |
<StackLayout ~drawerContent backgroundColor="#ffffff"> | |
<slot name="drawerContent"></slot> | |
</StackLayout> | |
<Frame ~mainContent> | |
<slot name="mainContent"></slot> | |
</Frame> | |
</RadSideDrawer> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<ScrollView> | |
<StackLayout v-for="(page, i) in pages" @tap="goToPage(page.component)" width="100%" borderBottomWidth="2px" borderBottomColor="#2e2e2e" :key="i"> | |
<Label verticalAlignment="center" width="100%" heigh="50" color="#000000" :text="page.name"/> | |
</StackLayout> | |
</ScrollView> | |
</template> | |
<script> | |
import sideDrawer from '~/mixins/sideDrawer' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<ScrollView> | |
<StackLayout width="100%"> | |
<Label | |
v-for="(page, i) in pages" | |
@tap="goToPage(page.component)" | |
verticalAlignment="center" | |
width="95%" | |
height="50" | |
color="#000000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<ScrollView> | |
<StackLayout width="100%"> | |
<Label | |
v-for="(page, i) in pages" | |
@tap="goToPage(page.component)" | |
verticalAlignment="center" | |
width="95%" | |
height="50" | |
color="#000000" |
OlderNewer