|
| 1 | +<%_ if (!rootOptions.router) { _%> |
| 2 | +<%# This code is the same as having a router. #%> |
| 3 | +<%# Setting this space aside for future possible use in the template #%> |
| 4 | +<template> |
| 5 | + <Page> |
| 6 | + <ActionBar :title="navbarTitle"/> |
| 7 | + <GridLayout rows="auto, auto"> |
| 8 | + <Button text="Home" @tap="goToHomePage" row="0"/> |
| 9 | + <Button text="About" @tap="goToAboutPage" row="1"/> |
| 10 | + </GridLayout> |
| 11 | + </Page> |
| 12 | +</template> |
| 13 | +<script> |
| 14 | + // ~ is an alias to /src |
| 15 | + import Home from '~/views/Home'; |
| 16 | + import About from '~/views/About'; |
| 17 | + |
| 18 | + export default { |
| 19 | + |
| 20 | + data() { |
| 21 | + return { |
| 22 | + navbarTitle: 'App.android.vue', |
| 23 | + } |
| 24 | + }, |
| 25 | + methods: { |
| 26 | + goToHomePage() { |
| 27 | + this.$navigateTo(Home); |
| 28 | + }, |
| 29 | + goToAboutPage() { |
| 30 | + this.$navigateTo(About); |
| 31 | + } |
| 32 | + } |
| 33 | + } |
| 34 | + |
| 35 | +</script> |
| 36 | +<%_ } else { _%> |
| 37 | +<%# This code is the same as not having a router. #%> |
| 38 | +<%# See note above #%> |
| 39 | +<template> |
| 40 | + <Page> |
| 41 | + <ActionBar :title="navbarTitle"/> |
| 42 | + <GridLayout rows="auto, auto"> |
| 43 | + <Button text="Home" @tap="goToHomePage" row="0"/> |
| 44 | + <Button text="About" @tap="goToAboutPage" row="1"/> |
| 45 | + </GridLayout> |
| 46 | + </Page> |
| 47 | +</template> |
| 48 | +<script> |
| 49 | + // ~ is an alias to /src |
| 50 | + import Home from '~/views/Home'; |
| 51 | + import About from '~/views/About'; |
| 52 | + |
| 53 | + export default { |
| 54 | + |
| 55 | + data() { |
| 56 | + return { |
| 57 | + navbarTitle: 'App.android.vue', |
| 58 | + } |
| 59 | + }, |
| 60 | + methods: { |
| 61 | + goToHomePage() { |
| 62 | + this.$navigateTo(Home); |
| 63 | + }, |
| 64 | + goToAboutPage() { |
| 65 | + this.$navigateTo(About); |
| 66 | + } |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | +</script> |
| 71 | +<%_ } _%> |
| 72 | + |
| 73 | +<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%> |
| 74 | +<style<%- |
| 75 | + rootOptions.cssPreprocessor |
| 76 | + ? ` lang="${ |
| 77 | + rootOptions.cssPreprocessor === 'sass' |
| 78 | + ? 'scss' |
| 79 | + : rootOptions.cssPreprocessor |
| 80 | + }"` |
| 81 | + : `` |
| 82 | +%>> |
| 83 | + ActionBar { |
| 84 | + color: #42b983; |
| 85 | + } |
| 86 | +</style> |
| 87 | +<%_ } else { _%> |
| 88 | +<style lang="stylus"> |
| 89 | + ActionBar |
| 90 | + color: #42b983 |
| 91 | +</style> |
| 92 | +<%_ } _%> |
0 commit comments