Commit a1a4808c authored by Pan's avatar Pan Committed by 花裤衩

fix tabsview bug

parent cfa82b07
...@@ -20,8 +20,15 @@ ...@@ -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: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment