vue element 关闭当前tab 跳转到上一路由

方法一

this.$store.dispatch('delVisitedViews', this.$route);
this.$router.go(-1);

 

方法二

this.$store.state.tagsView.visitedViews.splice(this.$store.state.tagsView.visitedViews.findIndex(item => item.path === this.$route.path), 1)
this.$router.push(this.$store.state.tagsView.visitedViews[this.$store.state.tagsView.visitedViews.length-1].path)
posted @ 2019-06-24 10:53  恋之呓  阅读(7757)  评论(1编辑  收藏  举报