Browse Source

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

pull/3806/head
Song XinXin 2 years ago
committed by GitHub
parent
commit
08a1f7b682
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/components/Form/src/helper.ts

2
src/components/Form/src/helper.ts

@ -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;
}

Loading…
Cancel
Save