Commit f2cf6da2 authored by wangdanlei's avatar wangdanlei

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

parent c0d2b0ea
<template> <template>
<section class="app-main"> <section class="app-main">
<transition name="fade-transform" mode="out-in"> <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" /> <router-view v-if="$route.meta&&$route.meta.keepAlive" :key="key" :path="key" class="router-view" />
</keep-alive> </keep-alive>
</transition> </transition>
...@@ -20,8 +20,7 @@ export default { ...@@ -20,8 +20,7 @@ export default {
return this.$store.state.tagsView.cachedViews return this.$store.state.tagsView.cachedViews
}, },
key() { key() {
// return this.$route.fullPath return this.$route.fullPath
return this.$route.path
} }
}, },
methods: { methods: {
......
...@@ -142,19 +142,19 @@ router.beforeEach(async(to, from, next) => { ...@@ -142,19 +142,19 @@ router.beforeEach(async(to, from, next) => {
]) ])
next({ ...to }) next({ ...to })
} else { } else {
if (to.meta.keepAlive && store.getters.visitedViews) { // if (to.meta.keepAlive && store.getters.visitedViews) {
for (const key in store.getters.visitedViews) { // for (const key in store.getters.visitedViews) {
const findHasRoute = store.getters.visitedViews[key].find(el => { // const findHasRoute = store.getters.visitedViews[key].find(el => {
return el.path === to.path // return el.path === to.path
}) // })
if (findHasRoute) { // if (findHasRoute) {
if (findHasRoute.fullPath !== to.fullPath) { // if (findHasRoute.fullPath !== to.fullPath) {
store.dispatch('tagsView/delCachedView', to) // store.dispatch('tagsView/delCachedView', to)
} // }
break // break
} // }
} // }
} // }
next() next()
} }
} }
...@@ -162,7 +162,7 @@ router.beforeEach(async(to, from, next) => { ...@@ -162,7 +162,7 @@ router.beforeEach(async(to, from, next) => {
}) })
function findModuleRoute(path, query) { function findModuleRoute(path, query) {
if (path === '/' || path === '/home') return null if (path === '/') return null
let result = null let result = null
const module = path.split('/')[1] 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