This commit is contained in:
pan
2024-09-09 01:18:21 +08:00
parent 05f662c0c7
commit 6a5157ae7d
9 changed files with 56 additions and 30 deletions

View File

@@ -45,7 +45,7 @@ export default {
},
computed: {
visitedViews() {
return this.$store.state.tagsView.visitedViews
return this.$store.state.tagsView.visitedViews ? this.$store.state.tagsView.visitedViews : []
},
routes() {
return this.$store.state.permission.routes
@@ -140,14 +140,15 @@ export default {
return false
},
moveToCurrentTag() {
let self = this
const tags = this.$refs.tag
this.$nextTick(() => {
self.$nextTick(() => {
for (const tag of tags) {
if (tag.to.path === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag)
self.$refs.scrollPane.moveToTarget(tag)
// when query is different then update
if (tag.to.fullPath !== this.$route.fullPath) {
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
self.$store.dispatch('tagsView/updateVisitedView', self.$route)
}
break
}