Created
October 16, 2018 00:27
-
-
Save JamieCurnow/2d8a3235ee254a3db6c16829b7e40555 to your computer and use it in GitHub Desktop.
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' | |
export default { | |
mixins: [sideDrawer], | |
data () { | |
// define our pages, making sure the component matches that defined in /app/router/index.js | |
pages: [ | |
{ name: 'Home', component: this.$routes.Home }, | |
{ name: 'Page One', component: this.$routes.PageOne }, | |
{ name: 'Page Two', component: this.$routes.PageTwo } | |
] | |
}, | |
methods: { | |
goToPage (pageComponent) { | |
// use the manual navigation method | |
this.$navigateTo(pageComponent) | |
// and we probably want to close the drawer when changing pages | |
this.closeDrawer() | |
} | |
} | |
} | |
</script> | |
<style lang="css"> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment