vue 中 watch 监听属性

data(){

  city:[]

},

watch: {

  handler: {

      city(newValue, oldValue){

          

     },

    immediate:  true,   //  需要在最初绑定值的时候去监听

    deep:true,  //  deep属性对对象进行深度监听

}

  

}

posted @ 2022-07-21 17:04  会飞de佩奇  阅读(108)  评论(0)    收藏  举报