feat: 根据路由元数据动态控制组件缓存并优化直播管理页面分页

This commit is contained in:
2025-10-22 12:42:43 +08:00
parent 5d6d3ff2d9
commit 3e752f2508
3 changed files with 37 additions and 7 deletions

View File

@@ -736,15 +736,29 @@ onMounted(() => {
>
<NElement>
<!-- 已验证邮箱的用户显示内容 -->
<RouterView v-if="accountInfo?.isEmailVerified" v-slot="{ Component }">
<KeepAlive>
<RouterView v-if="accountInfo?.isEmailVerified" v-slot="{ Component, route }">
<template v-if="route.meta.keepAlive">
<Suspense>
<component :is="Component" />
<template #default>
<KeepAlive>
<component :is="Component" />
</KeepAlive>
</template>
<template #fallback>
<NSpin show />
</template>
</Suspense>
</KeepAlive>
</template>
<template v-else>
<Suspense>
<template #default>
<component :is="Component" :key="route.fullPath" />
</template>
<template #fallback>
<NSpin show />
</template>
</Suspense>
</template>
</RouterView>
<!-- 未验证邮箱的提示 -->
<template v-else>