fix(BasicForm): 修复 SetFieldsValue 设置值时,会将 Number 类型的值转为 string (#3802)

This commit is contained in:
Song XinXin
2024-04-30 07:02:35 +08:00
committed by GitHub
parent 06018add79
commit 08a1f7b682

View File

@@ -72,7 +72,7 @@ export const defaultValueComponents = [
export function handleInputNumberValue(component?: ComponentType, val?: any) {
if (!component) return val;
if (defaultValueComponents.includes(component)) {
return val && isNumber(val) ? `${val}` : val;
return val && isNumber(val) ? val : `${val}`;
}
return val;
}