Skip to content

Instantly share code, notes, and snippets.

@JamieCurnow
Created October 16, 2018 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieCurnow/2d8a3235ee254a3db6c16829b7e40555 to your computer and use it in GitHub Desktop.
Save JamieCurnow/2d8a3235ee254a3db6c16829b7e40555 to your computer and use it in GitHub Desktop.
<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