vue computed+watch监听数据变化
vue computed+watch监听数据变化
data(){
return{
listQuery: {
QueryInfo: null,
PageNo: 1,
PageSize: 50
},
}
}
computed: {
QueryInfo: function() {
return this.listQuery.QueryInfo
}
},
watch: {
QueryInfo: function(val) {
// 这里函数
if (val === '') {
this.getList()
}
}
},
直接用computed+watch监听