//第一种,一步到位
this.$store.dispatch('app/delView', this.$route).then(() => {
this.$router.push({
path:'/liuManage/taskExecuteList'
});
});
//第二种
// 调用全局挂载的方法,关闭当前页
this.$store.dispatch("app/delView", this.$route);
// 关闭之后跳转你要跳转的路由
this.$router.push({ path: '/liuManage/taskExecuteList' });
// 返回上一步路由,第二种写法
this.$router.go(-1);
vue+elementUi 路由跳转,关闭当前的tab
最新推荐文章于 2024-03-30 16:59:38 发布
本文介绍了两种在前端应用中实现路由管理与页面切换的方法。第一种通过一次性操作,直接调用$store.dispatch删除视图并使用$router.push跳转至新页面。第二种则先关闭当前页面,随后使用$router.push进行跳转,或者利用$router.go(-1)返回上一页面。这两种方式在实际开发中都有其应用场景。

4765

被折叠的 条评论
为什么被折叠?



