Skip to content

Commit a1a4808

Browse files
committed
fix tabsview bug
1 parent cfa82b0 commit a1a4808

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/views/layout/TabsView.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@
2020
this.$store.dispatch('delVisitedViews', view)
2121
$event.preventDefault()
2222
},
23+
generateRoute() {
24+
if (this.$route.matched[this.$route.matched.length - 1].name) {
25+
return this.$route.matched[this.$route.matched.length - 1]
26+
}
27+
this.$route.matched[0].path = '/'
28+
return this.$route.matched[0]
29+
},
2330
addViewTabs() {
24-
this.$store.dispatch('addVisitedViews', this.$route.matched[this.$route.matched.length - 1])
31+
this.$store.dispatch('addVisitedViews', this.generateRoute())
2532
}
2633
},
2734
watch: {

0 commit comments

Comments
 (0)