1.关闭当前标签页并返回指定页面:

// 调用全局挂载的方法,关闭当前页
this.$store.dispatch("tagsView/delView", this.$route)
// 关闭之后跳转你要跳转的路由
this.$router.push({ path: '要跳转的页面路径' })
// 或者
this.$router.push({ name: '要跳转的页面名称' })

2.关闭当前标签页并返回上一步路由:

 // 调用全局挂载的方法,关闭当前页
 this.$store.dispatch("tagsView/delView", this.$route);
 // 返回上一步路由
 this.$router.go(-1)
Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐