From b4f6ef1465d5a5503055f70fb817c933d4faa443 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 10 Oct 2023 11:54:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=A1=E9=AA=8C=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/helper.ts | 2 +- src/components/Form/src/hooks/useFormEvents.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Form/src/helper.ts b/src/components/Form/src/helper.ts index 174ab298..930cad15 100644 --- a/src/components/Form/src/helper.ts +++ b/src/components/Form/src/helper.ts @@ -50,7 +50,7 @@ export function setComponentRuleType(rule: Rule, component: ComponentType, value export function processDateValue(attr: Recordable, component: string) { const { valueFormat, value } = attr if (valueFormat) - attr.value = isObject(value) ? dateUtil(value as any).format(valueFormat) : value + attr.value = isObject(value) ? dateUtil(value as unknown as Date).format(valueFormat) : value else if (DATE_TYPE.includes(component) && value) attr.value = dateUtil(attr.value) } diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index 8d743a89..eb7b048e 100644 --- a/src/components/Form/src/hooks/useFormEvents.ts +++ b/src/components/Form/src/hooks/useFormEvents.ts @@ -428,7 +428,7 @@ function getDefaultValue( } function checkIsRangeSlider(schema: FormSchema) { - if (schema.component === 'Slider' && schema.componentProps && schema.componentProps.range) + if (schema.component === 'Slider' && schema.componentProps && 'range' in schema.componentProps) return true }