单选框,获取当前选中项,名称
watch: {
'search.itemId'(value) {
this.currentItemName = this.itemList.find(v => v.value === value).label
}
},
搜索框置空会报错
watch: {
'search.itemId'(value) {
if (value) {
this.currentItemName = this.itemList.find(v => v.value === value).label
}
}
},