AppView.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <script setup lang="ts">
  2. import { useTagsViewStore } from '@/store/modules/tagsView'
  3. import { useAppStore } from '@/store/modules/app'
  4. import { Footer } from '@/layout/components/Footer'
  5. const appStore = useAppStore()
  6. const layout = computed(() => appStore.getLayout)
  7. const fixedHeader = computed(() => appStore.getFixedHeader)
  8. const footer = computed(() => appStore.getFooter)
  9. const tagsViewStore = useTagsViewStore()
  10. const getCaches = computed((): string[] => {
  11. return tagsViewStore.getCachedViews
  12. })
  13. </script>
  14. <template>
  15. <section
  16. :class="[
  17. 'p-[var(--app-content-padding)] w-[100%] bg-[var(--app-contnet-bg-color)] dark:bg-[var(--el-bg-color)]',
  18. {
  19. '!min-h-[calc(100%-var(--app-footer-height))]':
  20. fixedHeader && (layout === 'classic' || layout === 'topLeft') && footer,
  21. '!min-h-[calc(100%-var(--tags-view-height)-var(--top-tool-height)-var(--app-footer-height))]':
  22. ((!fixedHeader && layout === 'classic') || layout === 'top') && footer,
  23. '!min-h-[calc(100%-var(--tags-view-height)-var(--app-footer-height))]':
  24. !fixedHeader && layout === 'topLeft' && footer,
  25. '!min-h-[calc(100%-var(--top-tool-height))]': fixedHeader && layout === 'cutMenu' && footer,
  26. '!min-h-[calc(100%-var(--top-tool-height)-var(--tags-view-height))]':
  27. !fixedHeader && layout === 'cutMenu' && footer
  28. }
  29. ]"
  30. >
  31. <router-view>
  32. <template #default="{ Component, route }">
  33. <keep-alive :include="getCaches">
  34. <component :is="Component" :key="route.fullPath" />
  35. </keep-alive>
  36. </template>
  37. </router-view>
  38. </section>
  39. <Footer v-if="footer" />
  40. </template>