AppView.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script setup lang="ts">
  2. import { useTagsViewStore } from '@/store/modules/tagsView'
  3. import { useAppStore } from '@/store/modules/app'
  4. import { Footer } from '@/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-content-bg-color)] dark:bg-[var(--el-bg-color)]',
  19. {
  20. '!min-h-[calc(100%-var(--app-footer-height))]':
  21. ((fixedHeader && (layout === 'classic' || layout === 'topLeft')) || layout === 'top') &&
  22. footer,
  23. '!min-h-[calc(100%-var(--tags-view-height)-var(--top-tool-height)-var(--app-footer-height))]':
  24. !fixedHeader && layout === 'classic' && footer,
  25. '!min-h-[calc(100%-var(--tags-view-height)-var(--app-footer-height))]':
  26. !fixedHeader && (layout === 'topLeft' || layout === 'top') && footer,
  27. '!min-h-[calc(100%-var(--top-tool-height))]': fixedHeader && layout === 'cutMenu' && footer,
  28. '!min-h-[calc(100%-var(--top-tool-height)-var(--tags-view-height))]':
  29. !fixedHeader && layout === 'cutMenu' && footer
  30. }
  31. ]"
  32. >
  33. <router-view>
  34. <template #default="{ Component, route }">
  35. <keep-alive :include="getCaches">
  36. <component :is="Component" :key="route.fullPath" />
  37. </keep-alive>
  38. </template>
  39. </router-view>
  40. </section>
  41. <Footer v-if="footer" />
  42. </template>