props: ["content", "visible"],
watch: {
visible: {
handler: function(val, oldval) {
console.log("watch visible changed!")
if(val){
this.initDefault(this.content)
}
},
deep: true,
immediate: true
},
"content.id": {
handler: function(val, oldval) {
console.log("watch content.id changed!")
if(val !== oldval) {
this.initDefault(this.content)
}
},
deep: true,
immediate: true
},
},
No matter how the props changes, there is not a single print of the two watch. The same code has been used on other pages without any problem, but it is no good to use it in another place. There is no way to troubleshoot this kind of stupid problem like vue. Is there any other way except to close your eyes and guess, or smash the computer?