index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="_layout">
  3. <!-- <Header />
  4. <div class="tagBoss">
  5. <TagList />
  6. </div>
  7. <div class="_content">
  8. <router-view />
  9. </div> -->
  10. <div class="layout-left">
  11. <Menus />
  12. </div>
  13. <div class="layout-right">
  14. <div class="layout-header">
  15. <Header />
  16. <TagList />
  17. </div>
  18. <div class="layout-content">
  19. <router-view>
  20. <template #default="{ Component, route }">
  21. <keep-alive>
  22. <component :is="Component" :key="route.fullPath" />
  23. </keep-alive>
  24. </template>
  25. </router-view>
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <script setup lang="ts">
  31. import { useTagsViewStore } from '@/store/modules/tagsView'
  32. import Header from './header.vue'
  33. import TagList from './tagList.vue'
  34. import Menus from './menus.vue'
  35. const tagsViewStore = useTagsViewStore()
  36. const getCaches = computed((): string[] => {
  37. return tagsViewStore.getCachedViews
  38. })
  39. defineOptions({ name: 'Layout' })
  40. /** 初始化 **/
  41. onMounted(() => {})
  42. </script>
  43. <style lang="scss" scoped>
  44. ._layout {
  45. width: 100%;
  46. height: 100%;
  47. box-sizing: border-box;
  48. display: flex;
  49. align-items: center;
  50. justify-content: space-between;
  51. .layout-left {
  52. width: 184px;
  53. height: 100%;
  54. background: linear-gradient(180deg, #336fb6 0%, #0c4689 100%);
  55. }
  56. .layout-right {
  57. width: calc(100% - 184px);
  58. height: 100%;
  59. background: #eaf1f9;
  60. padding: 15px 15px;
  61. .layout-header {
  62. width: 100%;
  63. height: 100px;
  64. }
  65. .layout-content {
  66. width: 100%;
  67. height: calc(100% - 100px);
  68. }
  69. }
  70. }
  71. div,
  72. h1,
  73. h2,
  74. h3,
  75. h4,
  76. h5,
  77. h6,
  78. p,
  79. ul,
  80. li {
  81. box-sizing: border-box;
  82. }
  83. </style>