Showing
2 changed files
with
10 additions
and
2 deletions
| ... | ... | @@ -7,12 +7,20 @@ export default () => { |
| 7 | 7 | componentProps: { |
| 8 | 8 | placeholder: '请选择属性', |
| 9 | 9 | options, |
| 10 | + showSearch: true, | |
| 11 | + filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => { | |
| 12 | + let { label, value } = option; | |
| 13 | + label = label.toLowerCase(); | |
| 14 | + value = value.toLowerCase(); | |
| 15 | + inputValue = inputValue.toLowerCase(); | |
| 16 | + return label.includes(inputValue) || value.includes(inputValue); | |
| 17 | + }, | |
| 10 | 18 | }, |
| 11 | 19 | }); |
| 12 | 20 | if (Array.isArray(res)) { |
| 13 | 21 | opt = res.map((m) => { |
| 14 | 22 | return { |
| 15 | - label: m?.identifier, | |
| 23 | + label: m?.name, | |
| 16 | 24 | value: m?.identifier, |
| 17 | 25 | }; |
| 18 | 26 | }); | ... | ... |