vue关闭当前子页面

最近需求有个需要点击返回上级路由关闭当前路由,找了半天记一下

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 @ 2020-01-20 10:38  还能在码一行  阅读(7560)  评论(1编辑  收藏  举报