index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class='Layout'>
  3. <!-- 底部固定栏 -->
  4. <div class="bottom">
  5. <div class="row" @click="$router.push(item.path).catch(() => { })" v-for="item in data" :key="item.id">
  6. <img :src="require(`@/assets/img/layout/inco${item.id}${item.id === $route.meta.myInd ? 'Ac' : ''}.png`)" alt="">
  7. <p>{{ item.name }}</p>
  8. </div>
  9. </div>
  10. <Router-view />
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. components: {},
  16. data() {
  17. return {
  18. data: [
  19. { id: 1, path: '/layout/construct', name: '建筑可阅读' },
  20. { id: 2, path: '/layout/serve', name: '建筑可游玩' },
  21. { id: 3, path: '/layout/interact', name: '建筑可对话' },
  22. { id: 4, path: '/layout/my', name: '我的' },
  23. ]
  24. };
  25. },
  26. computed: {},
  27. watch: {},
  28. methods: {
  29. },
  30. created() {
  31. },
  32. mounted() {
  33. },
  34. beforeCreate() { }, //生命周期 - 创建之前
  35. beforeMount() { }, //生命周期 - 挂载之前
  36. beforeUpdate() { }, //生命周期 - 更新之前
  37. updated() { }, //生命周期 - 更新之后
  38. beforeDestroy() { }, //生命周期 - 销毁之前
  39. destroyed() { }, //生命周期 - 销毁完成
  40. activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  41. }
  42. </script>
  43. <style lang='less' scoped>
  44. .Layout {
  45. width: 100%;
  46. height: 100%;
  47. position: relative;
  48. .bottom {
  49. max-width: 500px;
  50. position: fixed;
  51. bottom: 0;
  52. left: 50%;
  53. transform: translateX(-50%);
  54. width: 100%;
  55. height: 80px;
  56. background-color: #fff;
  57. display: flex;
  58. align-items: center;
  59. .row{
  60. width: 25%;
  61. text-align: center;
  62. &>img{
  63. width: 30px;
  64. }
  65. &>p{
  66. margin-top: 5px;
  67. font-size: 12px;
  68. }
  69. }
  70. }
  71. }
  72. </style>