强的网站建设,青海省建设银行网站,网站内容发布平台源码,怎么申请域名和备案使用场景如#xff1a;当在新增/编辑路由页面提交成功后#xff0c;需要关闭当前页#xff0c;并跳转回列表页。 实现代码#xff1a;
this.$store.dispatch(tagsView/delView, this.$route); //关闭当前页
this.$router.replace({ path: /xxx/xxx当在新增/编辑路由页面提交成功后需要关闭当前页并跳转回列表页。 实现代码
this.$store.dispatch(tagsView/delView, this.$route); //关闭当前页
this.$router.replace({ path: /xxx/xxx }); // 要打开的页面我这里面开启了若依路由缓存所以跳回到列表页时页面并不会刷新。如果需要在回到列表页时主动刷新列表数据可以在跳转页面跳转前存到本地一个标识在列表页actived生命周期中获取标识获取到后将标识置为初始值不需刷新的标识并调用列表刷新方法。
实现代码
// 在新增/编辑路由页面
localStorage.setItem(IndexRefresh, true);
this.$store.dispatch(tagsView/delView, this.$route); //关闭当前页
this.$router.replace({ path: /xxx/xxx }); // 要打开的页面// 列表页
bash
activated() {if (localStorage.getItem(IndexRefresh) true) {localStorage.setItem(IndexRefresh, false);this.getList();}}