直接在子组件中增加一个observer监听变化即可,代码如下:
properties: {
cartNumber:{
type: Number,
value: 0,
observer (newVal, oldVal, changePath) {
console.log(newVal, oldVal, changePath)
}
}
},
网友回复
直接在子组件中增加一个observer监听变化即可,代码如下:
properties: {
cartNumber:{
type: Number,
value: 0,
observer (newVal, oldVal, changePath) {
console.log(newVal, oldVal, changePath)
}
}
},
网友回复