fix(组件): ms-select过滤修复

This commit is contained in:
baiqi 2024-11-20 10:34:38 +08:00 committed by Craftsman
parent 367e62e3da
commit 6e9d34dfef
1 changed files with 7 additions and 1 deletions

View File

@ -451,7 +451,9 @@ export default defineComponent(
return value; return value;
} }
const option = remoteOriginOptions.value.find( 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'); return option ? option[props.labelKey || 'label'] : props.optionNotExitsText || t('ms.select.optionsNotExits');
} }
@ -519,6 +521,10 @@ export default defineComponent(
} }
}} }}
onInputValueChange={handleInputValueChange} onInputValueChange={handleInputValueChange}
onClear={() => {
innerValue.value = props.multiple ? [] : '';
emit('update:modelValue', innerValue.value);
}}
> >
{{ {{
prefix: props.prefix ? () => t(props.prefix || '') : null, prefix: props.prefix ? () => t(props.prefix || '') : null,