|
|
@ -100,7 +100,10 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (route.children) { |
|
|
|
if (route.children) { |
|
|
|
const tempTags = this.filterAffixTags(route.children, route.path); |
|
|
|
const tempTags = this.filterAffixTags( |
|
|
|
|
|
|
|
route.children, |
|
|
|
|
|
|
|
route.path |
|
|
|
|
|
|
|
); |
|
|
|
if (tempTags.length >= 1) { |
|
|
|
if (tempTags.length >= 1) { |
|
|
|
tags = [...tags, ...tempTags]; |
|
|
|
tags = [...tags, ...tempTags]; |
|
|
|
} |
|
|
|
} |
|
|
@ -109,7 +112,9 @@ export default { |
|
|
|
return tags; |
|
|
|
return tags; |
|
|
|
}, |
|
|
|
}, |
|
|
|
initTags() { |
|
|
|
initTags() { |
|
|
|
const affixTags = (this.affixTags = this.filterAffixTags(this.routes)); |
|
|
|
const affixTags = (this.affixTags = this.filterAffixTags( |
|
|
|
|
|
|
|
this.routes |
|
|
|
|
|
|
|
)); |
|
|
|
for (const tag of affixTags) { |
|
|
|
for (const tag of affixTags) { |
|
|
|
// Must have tag name |
|
|
|
// Must have tag name |
|
|
|
if (tag.name) { |
|
|
|
if (tag.name) { |
|
|
@ -132,7 +137,10 @@ export default { |
|
|
|
this.$refs.scrollPane.moveToTarget(tag); |
|
|
|
this.$refs.scrollPane.moveToTarget(tag); |
|
|
|
// when query is different then update |
|
|
|
// when query is different then update |
|
|
|
if (tag.to.fullPath !== this.$route.fullPath) { |
|
|
|
if (tag.to.fullPath !== this.$route.fullPath) { |
|
|
|
this.$store.dispatch("tagsView/updateVisitedView", this.$route); |
|
|
|
this.$store.dispatch( |
|
|
|
|
|
|
|
"tagsView/updateVisitedView", |
|
|
|
|
|
|
|
this.$route |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -167,7 +175,9 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeAllTags(view) { |
|
|
|
closeAllTags(view) { |
|
|
|
this.$store.dispatch("tagsView/delAllViews").then(({ visitedViews }) => { |
|
|
|
this.$store |
|
|
|
|
|
|
|
.dispatch("tagsView/delAllViews") |
|
|
|
|
|
|
|
.then(({ visitedViews }) => { |
|
|
|
if (this.affixTags.some(tag => tag.path === view.path)) { |
|
|
|
if (this.affixTags.some(tag => tag.path === view.path)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|