记录:点击按钮,关闭当前页面及动态导航标签





// 返回
goBack(){
// this.$router.go(-1)
// this.$router.push({path: '/merchant/index'});
this.$modal.confirm("确认是否关闭当前页面")
.then(() => {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.replace({ path: "/merchant/index" }); // 关闭之后要返回的页面
})
}
参考文档:http://doc.ruoyi.vip/ruoyi-vue/document/qdsc.html#modal%E5%AF%B9%E8%B1%A1
该博客介绍了在Vue应用中如何实现点击按钮关闭当前页面,并同时管理动态导航标签。通过$modal确认对话框确保用户意图,然后利用$store和$router进行视图删除及页面跳转。参考了RuoYi-Vue的官方文档和掘金上的相关文章。
5645

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



