fix(选择器): 选择器选项不存在时显示修复

This commit is contained in:
baiqi 2024-07-18 15:48:54 +08:00 committed by 刘瑞斌
parent d52cace152
commit e887d92873
1 changed files with 3 additions and 0 deletions

View File

@ -447,6 +447,9 @@ export default defineComponent(
}); });
function checkOptionExit(label?: string) { function checkOptionExit(label?: string) {
if (typeof props.optionLabelRender === 'function') {
return label;
}
const option = remoteOriginOptions.value.find((e) => e[props.labelKey || 'label'] === label); const option = remoteOriginOptions.value.find((e) => e[props.labelKey || 'label'] === label);
return option ? option[props.labelKey || 'label'] : props.optionNotExitsText || t('ms.select.optionsNotExits'); return option ? option[props.labelKey || 'label'] : props.optionNotExitsText || t('ms.select.optionsNotExits');
} }