chore: improve filter (#8262)

This commit is contained in:
neverland
2021-03-04 11:27:39 +08:00
committed by GitHub
parent 9fd71923f9
commit 12be46fad8
10 changed files with 31 additions and 37 deletions
+2 -2
View File
@@ -106,11 +106,11 @@ export default createComponent({
return props.title;
}
const match = props.options.filter(
const match = props.options.find(
(option) => option.value === props.modelValue
);
return match.length ? match[0].text : '';
return match ? match.text : '';
};
const renderOption = (option: DropdownItemOption) => {