File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default {
38
38
}
39
39
this .pages = this .pages .filter (page => page .fullPath !== targetKey)
40
40
this .fullPathList = this .fullPathList .filter (path => path !== targetKey)
41
- },
41
+ }
42
42
},
43
43
watch: {
44
44
' $route ' : function (newVal ) {
@@ -53,4 +53,4 @@ export default {
53
53
}
54
54
}
55
55
}
56
- </script >
56
+ </script >
Original file line number Diff line number Diff line change 1
1
import MultiTab from './MultiTab'
2
- export default MultiTab
2
+ export default MultiTab
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export default {
5
5
return {}
6
6
},
7
7
render () {
8
- const { $route: { meta } } = this
8
+ const { $route: { meta }, $store : { getters } } = this
9
9
10
10
const inKeep = (
11
11
< keep- alive>
@@ -15,7 +15,10 @@ export default {
15
15
const notKeep = (
16
16
< router- view / >
17
17
)
18
- return meta .keepAlive ? inKeep : notKeep
18
+ // 这里增加了 multiTab 的判断,当开启了 multiTab 时
19
+ // 应当全部组件皆缓存,否则会导致切换页面后页面还原成原始状态
20
+ // 若确实不需要,可改为 return meta.keepAlive ? inKeep : notKeep
21
+ return meta .keepAlive || getters .multiTab ? inKeep : notKeep
19
22
}
20
23
}
21
- </script >
24
+ </script >
You can’t perform that action at this time.
0 commit comments