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
},
}
}