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,21 +1,10 @@
<template>
<div p-30px>
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/multi-level/level1.vue"
type="primary"
target="_blank"
class="mb-10"
>
示例源码 请点击>>>>
</el-link>
<div flex flex-col gap-20px>
<el-alert :closable="false" title="菜单一级" />
<KeepCache />
</div>
</div>
<el-alert :closable="false" title="菜单一级" />
</template>
<script setup lang="ts">
import KeepCache from "@/components/KeepCache/index.vue";
defineOptions({ name: "MultiLevel1" });
onMounted(() => {
console.log("MultiLevel1 mounted");
});
</script>