fix: 校验类型错误
parent
eb96488317
commit
b4f6ef1465
|
@ -50,7 +50,7 @@ export function setComponentRuleType(rule: Rule, component: ComponentType, value
|
||||||
export function processDateValue(attr: Recordable, component: string) {
|
export function processDateValue(attr: Recordable, component: string) {
|
||||||
const { valueFormat, value } = attr
|
const { valueFormat, value } = attr
|
||||||
if (valueFormat)
|
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)
|
else if (DATE_TYPE.includes(component) && value)
|
||||||
attr.value = dateUtil(attr.value)
|
attr.value = dateUtil(attr.value)
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,7 +428,7 @@ function getDefaultValue(
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkIsRangeSlider(schema: FormSchema) {
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue