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(() => { const options = computed(() => {
return props.options.map(option => { return props.options.map(option => {
if (typeof option === 'string') { if (typeof option === 'string' || typeof option === 'number') {
return { return {
label: option, label: option,
value: option, value: option,

View File

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