index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="app-container">
  3. <div class="layout-content">
  4. <keep-alive v-if="$route.meta.keepAlive">
  5. <router-view></router-view>
  6. </keep-alive>
  7. <router-view v-else></router-view>
  8. </div>
  9. <div class="layout-footer">
  10. <TabBar :data="tabbars" @change="handleChange" />
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import TabBar from '@/components/TabBar'
  16. export default {
  17. name: 'AppLayout',
  18. data() {
  19. return {
  20. tabbars: [
  21. {
  22. title: '学习中心',
  23. to: {
  24. path: '/home'
  25. },
  26. icon: 'home-o'
  27. }
  28. // {
  29. // title: '关于我',
  30. // to: {
  31. // path: 'About'
  32. // },
  33. // icon: 'user-o'
  34. // }
  35. ]
  36. }
  37. },
  38. components: {
  39. TabBar
  40. },
  41. methods: {
  42. handleChange(v) {
  43. console.log('tab value:', v)
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .app-container {
  50. height: 100%;
  51. .layout-content {
  52. }
  53. .layout-footer {
  54. }
  55. }
  56. </style>