Skip to content

Commit 0d41aa9

Browse files
committed
feat: select option support number #4570
close #4570
1 parent bd553de commit 0d41aa9

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

components/vc-select/utils/warningPropsUtil.ts

-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import warning, { noteOnce } from '../../vc-util/warning';
22
import type { SelectProps } from '..';
33
import { convertChildrenToData } from './legacyUtil';
4-
import type { OptionData } from '../interface';
54
import { toArray } from './commonUtil';
65
import type { RawValueType, LabelValueType } from '../interface/generator';
76
import { isValidElement } from '../../_util/props-util';
@@ -36,23 +35,6 @@ function warningProps(props: SelectProps) {
3635
'Please avoid setting option to disabled in tags mode since user can always type text as tag.',
3736
);
3837

39-
// `combobox` & `tags` should option be `string` type
40-
if (mode === 'tags' || mode === 'combobox') {
41-
const hasNumberValue = mergedOptions.some(item => {
42-
if (item.options) {
43-
return item.options.some(
44-
(opt: OptionData) => typeof ('value' in opt ? opt.value : opt.key) === 'number',
45-
);
46-
}
47-
return typeof ('value' in item ? item.value : item.key) === 'number';
48-
});
49-
50-
warning(
51-
!hasNumberValue,
52-
'`value` of Option should not use number type when `mode` is `tags` or `combobox`.',
53-
);
54-
}
55-
5638
// `combobox` should not use `optionLabelProp`
5739
warning(
5840
mode !== 'combobox' || !optionLabelProp,

0 commit comments

Comments
 (0)