index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class='Layout'>
  3. <div class="bottom">
  4. <div class="row" @click="$router.push(item.path).catch(() => { })" :class="{ active: item.id === $route.meta.myInd }"
  5. v-for="item in data" :key="item.id">{{ item.name }}
  6. </div>
  7. </div>
  8. <Router-view />
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. components: {},
  14. data() {
  15. return {
  16. data: [
  17. { id: 1, path: '/layout/construct', name: '览·古建', inco: '' },
  18. { id: 2, path: '/layout/serve', name: '享·服务', inco: '' },
  19. { id: 3, path: '/layout/interact', name: '悦·互动', inco: '' },
  20. { id: 4, path: '/layout/my', name: '我的', inco: '' },
  21. ]
  22. };
  23. },
  24. computed: {},
  25. watch: {},
  26. methods: {
  27. },
  28. created() {
  29. },
  30. mounted() {
  31. },
  32. beforeCreate() { }, //生命周期 - 创建之前
  33. beforeMount() { }, //生命周期 - 挂载之前
  34. beforeUpdate() { }, //生命周期 - 更新之前
  35. updated() { }, //生命周期 - 更新之后
  36. beforeDestroy() { }, //生命周期 - 销毁之前
  37. destroyed() { }, //生命周期 - 销毁完成
  38. activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  39. }
  40. </script>
  41. <style lang='less' scoped>
  42. .Layout {
  43. width: 100%;
  44. height: 100%;
  45. position: relative;
  46. .bottom {
  47. position: fixed;
  48. bottom: 0;
  49. left: 0;
  50. width: 100%;
  51. height: 40px;
  52. display: flex;
  53. justify-content: space-around;
  54. &>div {
  55. font-size: 16px;
  56. }
  57. .active {
  58. color: red;
  59. }
  60. }
  61. }
  62. </style>