From 219cab8f17d2fbedc7c186a2e61191a8676f779d Mon Sep 17 00:00:00 2001 From: haoziqaq <357229046@qq.com> Date: Sun, 17 Oct 2021 15:50:47 +0800 Subject: [PATCH] fix(ui/checkbox, radio): fix prop types affects: @varlet/ui --- packages/varlet-ui/src/checkbox/props.ts | 3 +++ packages/varlet-ui/src/radio-group/props.ts | 1 + packages/varlet-ui/src/radio/props.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/packages/varlet-ui/src/checkbox/props.ts b/packages/varlet-ui/src/checkbox/props.ts index 93acb3b722c..77752b5a65f 100644 --- a/packages/varlet-ui/src/checkbox/props.ts +++ b/packages/varlet-ui/src/checkbox/props.ts @@ -4,12 +4,15 @@ export type ValidateTriggers = 'onChange' export const props = { modelValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: false, }, checkedValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: true, }, uncheckedValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: false, }, checkedColor: { diff --git a/packages/varlet-ui/src/radio-group/props.ts b/packages/varlet-ui/src/radio-group/props.ts index 25f3ca23e5d..1ae82f43279 100644 --- a/packages/varlet-ui/src/radio-group/props.ts +++ b/packages/varlet-ui/src/radio-group/props.ts @@ -8,6 +8,7 @@ export function directionValidator(direction: string) { export const props = { modelValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: undefined, }, direction: { diff --git a/packages/varlet-ui/src/radio/props.ts b/packages/varlet-ui/src/radio/props.ts index 28ad2a07aae..5b0470dcebf 100644 --- a/packages/varlet-ui/src/radio/props.ts +++ b/packages/varlet-ui/src/radio/props.ts @@ -4,12 +4,15 @@ export type ValidateTriggers = 'onChange' export const props = { modelValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: false, }, checkedValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: true, }, uncheckedValue: { + type: [String, Number, Boolean, Object, Array] as PropType, default: false, }, disabled: {