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