Browse Source

feat: checkbox option support number

pull/5361/head
tangjinzhou 3 years ago
parent
commit
8f20fd514a
  1. 2
      components/checkbox/Group.tsx
  2. 4
      components/checkbox/interface.ts

2
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,

4
components/checkbox/interface.ts

@ -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,

Loading…
Cancel
Save