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:
15
src/App.vue
15
src/App.vue
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user