菜单优化

This commit is contained in:
吕金泽
2022-01-07 01:08:42 +08:00
parent bbb1c5ccc7
commit 02cd4e7986
8 changed files with 162 additions and 82 deletions
@@ -1,10 +1,9 @@
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<router-view :key="key" />
</keep-alive>
</transition>
<keep-alive>
<router-view v-if="$route.meta.keepAlive" :key="key" />
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" :key="key" />
</section>
</template>
@@ -12,9 +11,6 @@
export default {
name: 'AppMain',
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews
},
key() {
return this.$route.path
}
+17 -1
View File
@@ -1,3 +1,19 @@
<template>
<router-view />
<div>
<keep-alive>
<router-view v-if="$route.meta.keepAlive" :key="key" />
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" :key="key" />
</div>
</template>
<script>
export default {
name: 'None',
computed: {
key() {
return this.$route.path
}
}
}
</script>