这里适合watch
watch: {
'form.typeId': {
handler: function() {
if (!this.form.typeId) {
this.form.typeName = null
return
}
this.form.typeName = this.projectTypeOptions.find(item => { return item.key === this.form.typeId }).display_name
}
}
}
computed 只能监听整个数组