watch: {
test: {
immediate: true,
handler(newVal, oldVal) {
console.log(newVal, oldVal)
},
},
},
注意 immediate: true 的使用
https://forum.vuejs.org/t/watchers-not-triggered-on-initialization/12475
watch: {
test: {
immediate: true,
handler(newVal, oldVal) {
console.log(newVal, oldVal)
},
},
},
注意 immediate: true 的使用
https://forum.vuejs.org/t/watchers-not-triggered-on-initialization/12475
本文标题:vue 实例初始化时 prop 的 watcher 不执行
本文链接:https://www.haomeiwen.com/subject/vvpgjqtx.html
网友评论