fix: 🐛 (keep-alive)重构缓存机制

- 移除 KeepCache 组件,直接在 AppMain 中实现缓存逻辑

- 将 fullPath 做为组件缓存的 name
This commit is contained in:
zimo493
2025-09-01 11:11:45 +08:00
parent e37a6c5aa4
commit cc3750c128
9 changed files with 128 additions and 142 deletions

View File

@@ -1,18 +0,0 @@
<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>