修复多级页面关闭后再打开还缓存的bug
This commit is contained in:
parent
c336aef320
commit
0ee24af85e
|
|
@ -34,7 +34,7 @@
|
|||
:key="`tag-nav-${index}`"
|
||||
:name="item.name"
|
||||
:data-route-item="item"
|
||||
@on-close="handleClose(item)"
|
||||
@on-close="close(item)"
|
||||
@click.native="handleClick(item)"
|
||||
:closable="item.name !== $config.homeName"
|
||||
:color="isCurrentTag(item) ? 'primary' : 'default'"
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ export default {
|
|||
'setTagNavList',
|
||||
'addTag',
|
||||
'setLocal',
|
||||
'setHomeRoute'
|
||||
'setHomeRoute',
|
||||
'closeTag'
|
||||
]),
|
||||
...mapActions([
|
||||
'handleLogin',
|
||||
|
|
@ -140,6 +141,7 @@ export default {
|
|||
this.$router.push(nextRoute)
|
||||
}
|
||||
}
|
||||
this.closeTag(route)
|
||||
this.setTagNavList(res)
|
||||
},
|
||||
handleClick (item) {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
<template>
|
||||
<keep-alive :exclude="notCacheName">
|
||||
<keep-alive :include="cacheList" :exclude="notCacheName">
|
||||
<router-view ref="child"/>
|
||||
</keep-alive>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ParentView',
|
||||
data () {
|
||||
return {
|
||||
cacheChaildName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tagNavList () {
|
||||
return this.$store.state.app.tagNavList
|
||||
},
|
||||
notCacheName () {
|
||||
return (this.$route.meta && this.$route.meta.notCache) ? this.$route.name : ''
|
||||
return [(this.$route.meta && this.$route.meta.notCache) ? this.$route.name : '']
|
||||
},
|
||||
cacheList () {
|
||||
return ['ParentView', ...this.tagNavList.length ? this.tagNavList.filter(item => !(item.meta && item.meta.notCache)).map(item => item.name) : []]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue