mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-02-07 20:32:49 +08:00
优化 keep-alive 缓存方式
This commit is contained in:
parent
49dd4a55eb
commit
1012c419ac
@ -44,10 +44,9 @@
|
|||||||
<div class="main-box">
|
<div class="main-box">
|
||||||
<el-main>
|
<el-main>
|
||||||
<router-view v-slot="{ Component }">
|
<router-view v-slot="{ Component }">
|
||||||
<keep-alive>
|
<keep-alive :include="$global.visitedViews.filter(it => it.meta.keepAlive).map(it => it.path.substr(it.path.lastIndexOf('/') + 1))">
|
||||||
<component v-if="$route.meta.keepAlive" :is="Component" :key="$route.path" />
|
<component :is="Component" :key="$route.path" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
<component v-if="!$route.meta.keepAlive" :is="Component" :key="$route.path" />
|
|
||||||
</router-view>
|
</router-view>
|
||||||
</el-main>
|
</el-main>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<router-view v-slot="{ Component }">
|
<router-view v-slot="{ Component }">
|
||||||
<keep-alive>
|
<keep-alive :include="$global.visitedViews.filter(it => it.meta.keepAlive).map(it => it.path.substr(it.path.lastIndexOf('/') + 1))">
|
||||||
<component v-if="$route.meta.keepAlive" :is="Component" :key="$route.path" />
|
<component :is="Component" :key="$route.path" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
<component v-if="!$route.meta.keepAlive" :is="Component" :key="$route.path" />
|
|
||||||
</router-view>
|
</router-view>
|
||||||
</template>
|
</template>
|
Loading…
Reference in New Issue
Block a user