fix tabsview bug

This commit is contained in:
Pan 2017-07-03 11:16:19 +08:00 committed by 花裤衩
parent cfa82b0714
commit a1a4808c23
1 changed files with 8 additions and 1 deletions

View File

@ -20,8 +20,15 @@
this.$store.dispatch('delVisitedViews', view) this.$store.dispatch('delVisitedViews', view)
$event.preventDefault() $event.preventDefault()
}, },
generateRoute() {
if (this.$route.matched[this.$route.matched.length - 1].name) {
return this.$route.matched[this.$route.matched.length - 1]
}
this.$route.matched[0].path = '/'
return this.$route.matched[0]
},
addViewTabs() { addViewTabs() {
this.$store.dispatch('addVisitedViews', this.$route.matched[this.$route.matched.length - 1]) this.$store.dispatch('addVisitedViews', this.generateRoute())
} }
}, },
watch: { watch: {