computed: {
btnObj () {
let {patient, message, condition, doctor, date} = this
return {patient, message, condition, doctor, date}
}
},
watch: {
btnObj: {
handler (newVal,oldVal) {
if (newVal.patient && newVal.message && newVal.condition && newVal.doctor && newVal.date) {
this.isDisabled = false
} else {
this.isDisabled = true
}
},
deep: true,
immediate: true
}
}
vue中监听多个值
最新推荐文章于 2024-05-28 14:52:21 发布