From 6e9d34dfef339cbc8300dde06d649a10c0c11553 Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 20 Nov 2024 10:34:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BB=84=E4=BB=B6):=20=20ms-select?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/business/ms-select/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/business/ms-select/index.tsx b/frontend/src/components/business/ms-select/index.tsx index 5a563da592..dd50cad99b 100644 --- a/frontend/src/components/business/ms-select/index.tsx +++ b/frontend/src/components/business/ms-select/index.tsx @@ -451,7 +451,9 @@ export default defineComponent( return value; } const option = remoteOriginOptions.value.find( - (e) => e[props.valueKey || 'value'].toLowerCase() === value?.toLowerCase() + (e) => + e[props.valueKey || 'value'].toLowerCase() === value?.toLowerCase() || + e[props.labelKey || 'label'].toLowerCase() === value?.toLowerCase() ); return option ? option[props.labelKey || 'label'] : props.optionNotExitsText || t('ms.select.optionsNotExits'); } @@ -519,6 +521,10 @@ export default defineComponent( } }} onInputValueChange={handleInputValueChange} + onClear={() => { + innerValue.value = props.multiple ? [] : ''; + emit('update:modelValue', innerValue.value); + }} > {{ prefix: props.prefix ? () => t(props.prefix || '') : null,