2023-06-21 19:14:34 +08:00
|
|
|
<script lang="ts" setup>
|
2023-02-11 00:44:00 +08:00
|
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
import { useAppStore } from '@/store/modules/app'
|
|
|
|
import { Footer } from '@/layout/components/Footer'
|
|
|
|
|
2023-06-21 19:14:34 +08:00
|
|
|
defineOptions({ name: 'AppView' })
|
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
const appStore = useAppStore()
|
|
|
|
|
|
|
|
const layout = computed(() => appStore.getLayout)
|
|
|
|
|
|
|
|
const fixedHeader = computed(() => appStore.getFixedHeader)
|
|
|
|
|
|
|
|
const footer = computed(() => appStore.getFooter)
|
|
|
|
|
|
|
|
const tagsViewStore = useTagsViewStore()
|
|
|
|
|
|
|
|
const getCaches = computed((): string[] => {
|
|
|
|
return tagsViewStore.getCachedViews
|
|
|
|
})
|
2023-07-29 14:40:55 +08:00
|
|
|
|
|
|
|
const tagsView = computed(() => appStore.getTagsView)
|
2023-02-11 00:44:00 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<section
|
|
|
|
:class="[
|
2023-07-29 14:40:55 +08:00
|
|
|
'p-[var(--app-content-padding)] w-[calc(100%-var(--app-content-padding)-var(--app-content-padding))] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]',
|
2023-02-11 00:44:00 +08:00
|
|
|
{
|
2023-07-29 14:40:55 +08:00
|
|
|
'!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]':
|
|
|
|
(fixedHeader &&
|
|
|
|
(layout === 'classic' || layout === 'topLeft' || layout === 'top') &&
|
|
|
|
footer) ||
|
|
|
|
(!tagsView && layout === 'top' && footer),
|
|
|
|
'!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height)-var(--tags-view-height))]':
|
|
|
|
tagsView && layout === 'top' && footer,
|
|
|
|
|
|
|
|
'!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--top-tool-height)-var(--app-footer-height))]':
|
2023-04-15 01:06:48 +08:00
|
|
|
!fixedHeader && layout === 'classic' && footer,
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-07-29 14:40:55 +08:00
|
|
|
'!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]':
|
|
|
|
!fixedHeader && layout === 'topLeft' && footer,
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-07-29 14:40:55 +08:00
|
|
|
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding))]':
|
|
|
|
fixedHeader && layout === 'cutMenu' && footer,
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-07-29 14:40:55 +08:00
|
|
|
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]':
|
2023-02-11 00:44:00 +08:00
|
|
|
!fixedHeader && layout === 'cutMenu' && footer
|
|
|
|
}
|
|
|
|
]"
|
|
|
|
>
|
|
|
|
<router-view>
|
|
|
|
<template #default="{ Component, route }">
|
|
|
|
<keep-alive :include="getCaches">
|
|
|
|
<component :is="Component" :key="route.fullPath" />
|
|
|
|
</keep-alive>
|
|
|
|
</template>
|
|
|
|
</router-view>
|
|
|
|
</section>
|
|
|
|
<Footer v-if="footer" />
|
|
|
|
</template>
|