关闭当前路由,跳转其他页面
close() {
// 返回上级路由并关闭当前路由
this.$store.state.tagsView.visitedViews.splice(this.$store.state.tagsView.visitedViews.findIndex(item => item.path === this.$route.path), 1)
this.$router.push('目标页面的路由地址’)
}
举例:
目标页面的路由地址:'/test/list'
这篇博客详细介绍了如何在应用中实现关闭当前路由并跳转到目标页面的操作。通过访问并修改Vuex状态来移除当前路由,并使用$router.push()方法实现页面跳转。示例代码展示了如何跳转到'/test/list'页面。
1767

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



