watch: {
uploadObj: {//监听对象
deep: true,
immediate: true,
handler: function(value) {
if (!value.receiver && !value.receiveBastionIds) {
this.userArrShow = true;
this.machineSelectShow = true;
this.$message.warning("接收人及接收堡垒机至少选择一项,请重新填写。");
} else {
this.userArrShow = false;
this.machineSelectShow = false;
}
}
},
"uploadObj.receiveBastionIds": {//监听对象下的某个属性
handler: function (value) {
if (this.resetFlag2) {
this.userArrShow = false;
this.machineSelectShow = false;
this.resetFlag2 = false;
} else {
if (!this.uploadObj.receiver && !this.uploadObj.receiveBastionIds) {
this.userArrShow = true;
this.machineSelectShow = true;
this.$message.warning(
"接收人及接收堡垒机至少选择一项,请重新填写。"
);
} else {
this.userArrShow = false;
this.machineSelectShow = false;
}
}
},
},
},
vue监听对象某一个属性
于 2020-07-31 13:42:27 首次发布
928

被折叠的 条评论
为什么被折叠?



