解决keepAlive缓存设置

This commit is contained in:
zilong
2021-10-21 23:57:50 +08:00
parent 8448b293a9
commit 4ade4395d4
19 changed files with 390 additions and 69 deletions

View File

@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -1,8 +1,13 @@
<script setup>
import { h } from "vue";
import { h, onUnmounted } from "vue";
import { RouterLink, useRoute } from "vue-router";
import { NButton, NSpace, NIcon, NMenu } from "naive-ui";
console.log("Videos 初始化");
onUnmounted(() => {
console.log("Videos 卸载");
});
const menuOptions = [
{
label: () =>
@@ -29,11 +34,10 @@ const menuOptions = [
{ default: () => "MV" }
),
key: "/videos/mv",
}
},
];
const route = useRoute()
const route = useRoute();
</script>
<template>
<div class="top-menu">
@@ -44,14 +48,14 @@ const route = useRoute()
:value="route.path"
/>
</div>
<router-view />
<router-view v-slot="{ Component }">
<keep-alive>
<component :is="Component" />
</keep-alive>
</router-view>
</template>
<script>
export default {
}
export default {};
</script>
<style>
</style>
<style></style>