调整
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user