index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!-- 💥 这里是一次性加载 LayoutComponents -->
  2. <template>
  3. <component :is="LayoutComponents[layout]" />
  4. <!-- <ThemeDrawer />-->
  5. <RightPanel v-if="showSettings">
  6. <Settings />
  7. </RightPanel>
  8. </template>
  9. <script setup lang="ts" name="layout">
  10. import { computed, type Component } from 'vue'
  11. import { LayoutType } from '@/store/interface'
  12. // import { AppMain, Settings, TagsView } from './components/index'
  13. import useStore from '@/store'
  14. // import { useGlobalStore } from "@/stores/modules/global";
  15. // import ThemeDrawer from './components/ThemeDrawer/index.vue'
  16. import RightPanel from '@/components/RightPanel/index.vue'
  17. import LayoutClassic from './LayoutClassic/index.vue'
  18. import LayoutTransverse from './LayoutTransverse/index.vue'
  19. import LayoutVertical from './LayoutVertical/index.vue'
  20. import LayoutColumns from './LayoutColumns/index.vue'
  21. import { Settings } from '@/layout/components'
  22. const LayoutComponents: Record<LayoutType, Component> = {
  23. classic: LayoutClassic,
  24. transverse: LayoutTransverse,
  25. vertical: LayoutVertical,
  26. columns: LayoutColumns
  27. }
  28. const { setting } = useStore()
  29. // const globalStore = useGlobalStore();
  30. // const layout = computed(() => setting.layout)
  31. const layout = computed(() => setting.layout)
  32. const showSettings = computed(() => setting.showSettings)
  33. </script>
  34. <style scoped lang="scss">
  35. .layout {
  36. min-width: 600px;
  37. }
  38. </style>