vue 监听对象中的一个属性的变化
watch: {
'obj.name': {
handler(newVal) {
alert(newVal)
}
}
},
将对象的属性用引号包起来就可以正常解析了
watch: {
'obj.name': {
handler(newVal) {
alert(newVal)
}
}
},
将对象的属性用引号包起来就可以正常解析了