index.vue 948 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <component :is="LayoutComponents[layout]" />
  3. <ThemeSettings v-if="showSettings" />
  4. </template>
  5. <script setup lang="ts" name="layout">
  6. import { computed, type Component } from 'vue'
  7. import { LayoutType } from '@/store/interface'
  8. import useStore from '@/store'
  9. // import RightPanel from '@/components/RightPanel/index-old.vue'
  10. import LayoutLeft from './LayoutLeft/index.vue'
  11. import LayoutLeftMix from './LayoutLeftMix/index.vue'
  12. import LayoutTop from './LayoutTop/index.vue'
  13. import LayoutTopMix from './LayoutTopMix/index.vue'
  14. import { ThemeSettings } from '@/layout/components'
  15. const LayoutComponents: Record<LayoutType, Component> = {
  16. left: LayoutLeft,
  17. leftMix: LayoutLeftMix,
  18. topMix: LayoutTopMix,
  19. top: LayoutTop
  20. }
  21. const { setting } = useStore()
  22. const layout = computed(() => setting.layout)
  23. const showSettings = computed(() => setting.showSettings)
  24. </script>
  25. <style scoped lang="scss">
  26. .layout {
  27. min-width: 600px;
  28. }
  29. </style>