使用vue的全局函数
// this.$route 当前页签路由,既要关闭的页签路由
this.$store.dispatch('tagsView/delView', this.$route).then(() => {
this.$router.replace({ path:'xxx' }) // 关闭后要去往的页签路由
})
这篇博客介绍了如何在Vue应用中利用$store.dispatch和$router.replace来实现页签的关闭以及跳转到新的路由。通过调用'tagsView/delView' action删除当前页签路由,并随即替换为指定路径的路由。
使用vue的全局函数
// this.$route 当前页签路由,既要关闭的页签路由
this.$store.dispatch('tagsView/delView', this.$route).then(() => {
this.$router.replace({ path:'xxx' }) // 关闭后要去往的页签路由
})
4924
742
1632

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