add:when active tabs closed will go to last path

This commit is contained in:
Pan
2017-09-01 10:46:20 +08:00
parent cb0e889829
commit f712d4682e
2 changed files with 12 additions and 5 deletions

View File

@@ -17,7 +17,11 @@ export default {
},
methods: {
closeViewTabs(view, $event) {
this.$store.dispatch('delVisitedViews', view)
this.$store.dispatch('delVisitedViews', view).then((views) => {
if (this.isActive(view.path)) {
this.$router.push(views.pop().path)
}
})
$event.preventDefault()
},
generateRoute() {