From 8f20fd514a6d7adf39ac657d15ba05fdc952aca1 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 17 Mar 2022 10:23:58 +0800 Subject: [PATCH] feat: checkbox option support number --- components/checkbox/Group.tsx | 2 +- components/checkbox/interface.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/checkbox/Group.tsx b/components/checkbox/Group.tsx index c20e48334..1ec861e1e 100644 --- a/components/checkbox/Group.tsx +++ b/components/checkbox/Group.tsx @@ -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, diff --git a/components/checkbox/interface.ts b/components/checkbox/interface.ts index ee84ee635..3b132e56f 100644 --- a/components/checkbox/interface.ts +++ b/components/checkbox/interface.ts @@ -16,8 +16,8 @@ export const abstractCheckboxGroupProps = () => { name: String, prefixCls: String, options: { - type: Array as PropType>, - default: () => [] as Array, + type: Array as PropType>, + default: () => [] as Array, }, disabled: Boolean, id: String,