This commit is contained in:
@@ -197,8 +197,12 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 默认关闭所有的标签
|
||||
this.handleTagsOption('all')
|
||||
// 默认关闭所有的标签(仅在进入首页时重置)。
|
||||
// 注意:直接输入地址/刷新进入子页面时不能重置,因为 handleTagsOption('all') 会触发
|
||||
// 父组件的 handleCloseTag(res, 'all'),进而 turnToPage('home') 把页面弹回首页,导致深链接失效。
|
||||
if (this.$route.name === this.$config.homeName) {
|
||||
this.handleTagsOption('all')
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.getTagElementByName(this.$route)
|
||||
}, 200)
|
||||
|
||||
@@ -154,6 +154,13 @@ export default {
|
||||
this.addTag({
|
||||
route: this.$store.state.app.homeRoute
|
||||
})
|
||||
// 直接输入地址/刷新进入时,localStorage 恢复的标签栏里没有当前页面,
|
||||
// 这里把它补进标签栏,而不是直接跳回首页,否则深链接会被弹回首页
|
||||
if (this.$route.name && this.$route.name !== this.$config.homeName) {
|
||||
this.addTag({
|
||||
route: this.$route
|
||||
})
|
||||
}
|
||||
this.setBreadCrumb(this.$route)
|
||||
// 如果当前打开页面不在标签栏中,跳到homeName页
|
||||
if (!this.tagNavList.find(item => item.name === this.$route.name)) {
|
||||
|
||||
Reference in New Issue
Block a user