Commit f2cf6da2 authored by wangdanlei's avatar wangdanlei

合并产品【10700】任务详情页页面缓存配置失效(原始bug 5560)

parent c0d2b0ea
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<keep-alive :include="cachedViews" :max="10">
<router-view v-if="$route.meta&&$route.meta.keepAlive" :key="key" :path="key" class="router-view" />
</keep-alive>
</transition>
......@@ -20,8 +20,7 @@ export default {
return this.$store.state.tagsView.cachedViews
},
key() {
// return this.$route.fullPath
return this.$route.path
return this.$route.fullPath
}
},
methods: {
......
......@@ -142,19 +142,19 @@ router.beforeEach(async(to, from, next) => {
])
next({ ...to })
} else {
if (to.meta.keepAlive && store.getters.visitedViews) {
for (const key in store.getters.visitedViews) {
const findHasRoute = store.getters.visitedViews[key].find(el => {
return el.path === to.path
})
if (findHasRoute) {
if (findHasRoute.fullPath !== to.fullPath) {
store.dispatch('tagsView/delCachedView', to)
}
break
}
}
}
// if (to.meta.keepAlive && store.getters.visitedViews) {
// for (const key in store.getters.visitedViews) {
// const findHasRoute = store.getters.visitedViews[key].find(el => {
// return el.path === to.path
// })
// if (findHasRoute) {
// if (findHasRoute.fullPath !== to.fullPath) {
// store.dispatch('tagsView/delCachedView', to)
// }
// break
// }
// }
// }
next()
}
}
......@@ -162,7 +162,7 @@ router.beforeEach(async(to, from, next) => {
})
function findModuleRoute(path, query) {
if (path === '/' || path === '/home') return null
if (path === '/') return null
let result = null
const module = path.split('/')[1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment