Vue中watch监听对象中的属性

参考地址:https://blog.csdn.net/u014298440/article/details/82942680

1.一般监听

 queryData: {
     name: '',
     creator: '',
     selectedStatus: '',
     time: [],
 }

2.监听对象(深度监听):

watch: {
     queryData: {
         handler: function() {
            //do something
         },
         deep: true
     }
}

3.监听对象里面的属性:

watch: {
     'queryData.name': {
         handler: function() {
            //do something
         },
     }
}
posted @ 2022-12-06 22:19  轻风细雨_林木木  阅读(18)  评论(0编辑  收藏  举报