场景:父页面A,子页面B。从父页面A跳转到子页面B,进行添加操作,添加完成,关闭子页面B,跳转回父页面A。因为新增一条数据,需要重新加载列表。
父页面A局部代码如下
watch: {
$route(to, from) {
// console.log("到哪个页面去", to.path);
// console.log("从哪个页面来", from.path);
if (to.path == "/asset/allasset" && from.path == "/asset/addasset") {
this.quireHostList();
}
}
}