index.vue 1.1 KB

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