feat: (components)添加 KeepCache 组件用于统一处理页面缓存

This commit is contained in:
zimo493
2025-08-14 09:38:21 +08:00
parent 3c010168df
commit f557f2e5ad

View File

@@ -0,0 +1,18 @@
<template>
<router-view>
<template #default="{ Component, route }">
<transition enter-active-class="animate__animated animate__fadeIn" mode="out-in">
<keep-alive :include="tagsViewStore.cachedViews">
<component :is="Component" :key="route.path" />
</keep-alive>
</transition>
</template>
</router-view>
</template>
<script setup lang="ts">
defineOptions({ name: "KeepCache" });
import { useTagsViewStore } from "@/store";
const tagsViewStore = useTagsViewStore();
</script>