feat: checkbox option support number

pull/5361/head
tangjinzhou 2022-03-17 10:23:58 +08:00
parent 4b9fe8242e
commit 8f20fd514a
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ export default defineComponent({
);
const options = computed(() => {
return props.options.map(option => {
if (typeof option === 'string') {
if (typeof option === 'string' || typeof option === 'number') {
return {
label: option,
value: option,

View File

@ -16,8 +16,8 @@ export const abstractCheckboxGroupProps = () => {
name: String,
prefixCls: String,
options: {
type: Array as PropType<Array<CheckboxOptionType | string>>,
default: () => [] as Array<CheckboxOptionType | string>,
type: Array as PropType<Array<CheckboxOptionType | string | number>>,
default: () => [] as Array<CheckboxOptionType | string | number>,
},
disabled: Boolean,
id: String,