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 }