vue2.0监听数组中对象属性的变化
vue项目中如何对数组中的对象属性变化进行监听呢?data () {return {aDemo: [{key1: '',key2: ''}]}},watch: {aDemo:{handler: function (newVal) {
·
vue项目中如何对数组中的对象属性变化进行监听呢?
aDemo: [
{
key1: '',
key2: ''
}
]
}
},
watch: {
aDemo:{
handler: function (newVal) {
console.log(newVal)
},
deep: true //深度监听
}
}
data () {
return {aDemo: [
{
key1: '',
key2: ''
}
]
}
},
watch: {
aDemo:{
handler: function (newVal) {
console.log(newVal)
},
deep: true //深度监听
}
}
更多推荐
已为社区贡献20条内容
所有评论(0)