【修改】修改缓存路由

This commit is contained in:
fengachen
2022-03-24 17:42:22 +08:00
parent ada2c133e3
commit 89430d6b19
+11 -6
View File
@@ -21,12 +21,14 @@
</a-tabs>
<div style="margin: 12px 12px 0; overflow-x: auto">
<!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
<keep-alive v-if="multipage && keepAlive">
<router-view :key="$route.fullPath" v-if="reloadFlag"/>
<keep-alive >
<router-view v-if="keepAlive"/>
</keep-alive>
<template v-else>
<router-view :key="$route.fullPath" v-if="reloadFlag"/>
</template>
<!-- <template v-else>-->
<!-- {{12344444444444444}}-->
<!-- -->
<!-- </template>-->
<router-view :key="$route.fullPath" v-if="!keepAlive"/>
<!-- update-end-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
</div>
</global-layout>
@@ -73,11 +75,13 @@
/* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
computed: {
keepAlive() {
console.log(this.$route.meta.keepAlive,'this.$route.meta.keepAlivethis.$route.meta.keepAlive')
return this.$route.meta.keepAlive
},
multipage() {
//判断如果是手机模式,自动切换为单页面模式
if (this.isMobile()) {
console.log()
return false
} else {
return this.$store.state.app.multipage
@@ -115,7 +119,8 @@
},
watch: {
'$route': function(newRoute) {
//console.log("新的路由",newRoute)
// console.log("新的路由",newRoute)
console.log(this.$store)
this.activePage = newRoute.fullPath
if (!this.multipage) {
this.linkList = [newRoute.fullPath]