AppView.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <script lang="ts" name="AppView" setup>
  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-content-bg-color)] dark:bg-[var(--el-bg-color)]',
  18. {
  19. '!min-h-[calc(100%-var(--app-footer-height))]':
  20. ((fixedHeader && (layout === 'classic' || layout === 'topLeft')) || layout === 'top') &&
  21. footer,
  22. '!min-h-[calc(100%-var(--tags-view-height)-var(--top-tool-height)-var(--app-footer-height))]':
  23. !fixedHeader && layout === 'classic' && footer,
  24. '!min-h-[calc(100%-var(--tags-view-height)-var(--app-footer-height))]':
  25. !fixedHeader && (layout === 'topLeft' || layout === 'top') && 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>