vue项目中如何对数组中的对象属性变化进行监听呢?


data () {

return {
aDemo: [
        {
          key1: '',
          key2: ''
        }
      ]
}
},
watch: {    
aDemo:{
handler: function (newVal) {
        console.log(newVal)   
    },      
deep: true    //深度监听

}
Logo

前往低代码交流专区

更多推荐