写了两个组件A & B,在A中,使用route.push()
路由到组件B,在组件B中,使用route.go(-1)
返回组件A。两个组件中都有一个相同的字组件,子组件中有一个watcher:
watch: {
page: {
handler(newValue) {
console.log("pWatchNew:"+newValue)
Object.assign(this.pageSet, newValue);
},
deep: true
},
}
在使用route.push()
路由到组件B时,watch能观察到page
的变化,但是在组件B用route.go(-1)
返回A时,watch不执行