有一个数据源对象如下,我只想监听它的 BusinessModel.model.order_type 这个值
BusinessModel: {
width: "100px",
show: false,
title: "新增",
model: {
id: "",
order_id: "",
order_no: "",
order_type: "",
bill_status: "",
product_time: "",
IsScheduled: "",
batch_no: "",
supplier_id: "",
start_time: "",
end_time: "",
rice_type: "",
item_id: "",
qty: "",
path: "",
createby: "",
create_time: "",
update_by: "",
update_time: "",
Remark: "",
sort_index: "",
Items: [] //明细
},
},
在watch的时候这样写,而不是用deep
watch: {
'BusinessModel.model.order_type': {
handler(val) {
},
immediate: true
}
},
写成一个字符串 'BusinessModel.model.order_type' 就好了