AppView.vue 1.7 KB

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