1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-12-29 04:20:22 +08:00

fix:修复keep-alive失效问题,并添加keep-alive测试页面

This commit is contained in:
zhangchuanlong
2022-03-04 16:44:33 +08:00
parent 402c7db7ba
commit 8bcbcac531
5 changed files with 51 additions and 18 deletions

View File

@@ -3,16 +3,11 @@ import AppProvider from '@/components/AppProvider/index.vue'
</script>
<template>
<router-view>
<template #default="{ Component, route }">
<app-provider>
<keep-alive v-if="route.meta && route.meta.keepAlive">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
<component :is="Component" v-else :key="route.fullPath" />
</app-provider>
</template>
</router-view>
<app-provider>
<router-view v-slot="{ Component }">
<component :is="Component" />
</router-view>
</app-provider>
</template>
<style lang="scss">