fix[TagView-component]: loss route querystring when operating tags (#768)

This commit is contained in:
临书 2018-06-13 16:57:07 +08:00 committed by 花裤衩
parent 2a590a2087
commit cbee7b6f20

View file

@ -72,7 +72,7 @@ export default {
const tags = this.$refs.tag const tags = this.$refs.tag
this.$nextTick(() => { this.$nextTick(() => {
for (const tag of tags) { for (const tag of tags) {
if (tag.to === this.$route.path) { if (tag.to.path === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag.$el) this.$refs.scrollPane.moveToTarget(tag.$el)
break break
} }
@ -84,7 +84,7 @@ export default {
if (this.isActive(view)) { if (this.isActive(view)) {
const latestView = views.slice(-1)[0] const latestView = views.slice(-1)[0]
if (latestView) { if (latestView) {
this.$router.push(latestView.path) this.$router.push(latestView)
} else { } else {
this.$router.push('/') this.$router.push('/')
} }
@ -92,7 +92,7 @@ export default {
}) })
}, },
closeOthersTags() { closeOthersTags() {
this.$router.push(this.selectedTag.path) this.$router.push(this.selectedTag)
this.$store.dispatch('delOthersViews', this.selectedTag).then(() => { this.$store.dispatch('delOthersViews', this.selectedTag).then(() => {
this.moveToCurrentTag() this.moveToCurrentTag()
}) })