2025-01-08 05:26:12 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
import type { ConfigProviderTheme } from 'vant'
|
|
|
|
import useKeepalive from '~/composables/keepalive'
|
2025-01-08 07:32:54 +00:00
|
|
|
import { appName, appDescription } from '~/constants'
|
|
|
|
import { useI18n } from 'vue-i18n'
|
2025-01-08 05:26:12 +00:00
|
|
|
|
|
|
|
useHead({
|
2025-01-08 07:32:54 +00:00
|
|
|
title: useI18n().t('appSetting.appName'),
|
|
|
|
meta: [
|
|
|
|
{ name: 'description', content: useI18n().t('appSetting.appDescription') },
|
|
|
|
],
|
2025-01-08 05:26:12 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
const color = useColorMode()
|
|
|
|
|
|
|
|
const mode = computed(() => {
|
|
|
|
return color.value as ConfigProviderTheme
|
|
|
|
})
|
|
|
|
|
|
|
|
const keepAliveRouteNames = computed(() => {
|
|
|
|
return useKeepalive().routeCaches as string[]
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<VanConfigProvider :theme="mode">
|
2025-01-08 07:32:54 +00:00
|
|
|
<NuxtLoadingIndicator
|
|
|
|
color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
|
2025-01-08 05:26:12 +00:00
|
|
|
<NuxtLayout>
|
|
|
|
<NuxtPage :keepalive="{ include: keepAliveRouteNames }" />
|
|
|
|
</NuxtLayout>
|
|
|
|
</VanConfigProvider>
|
|
|
|
</template>
|
2025-01-08 07:32:54 +00:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.page-enter-active,
|
|
|
|
.page-leave-active {
|
|
|
|
transition: all 0.2s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.page-enter-from,
|
|
|
|
.page-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
filter: blur(1rem);
|
|
|
|
}
|
|
|
|
</style>
|