Skip to content

Instantly share code, notes, and snippets.

@JamieCurnow
Created October 16, 2018 00:35
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/208ce5522efda5bd22e9273cb75084bd to your computer and use it in GitHub Desktop.
Save JamieCurnow/208ce5522efda5bd22e9273cb75084bd to your computer and use it in GitHub Desktop.
<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"
:text="page.name"
borderBottomWidth="2px"
borderBottomColor="#2e2e2e"
:key="i"
/>
</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