Browse Source

fix: 修复updateSchema之后会把已填值重置为defaultValue的问题 (#1792)

pull/1820/head
Henry Rao 5 years ago
committed by GitHub
parent
commit
b41e3939ac
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/components/Form/src/hooks/useFormValues.ts

5
src/components/Form/src/hooks/useFormValues.ts

@ -118,7 +118,10 @@ export function useFormValues({
const { defaultValue } = item;
if (!isNullOrUnDef(defaultValue)) {
obj[item.field] = defaultValue;
formModel[item.field] = defaultValue;
if (formModel[item.field] === undefined) {
formModel[item.field] = defaultValue;
}
}
});
defaultValueRef.value = obj;

Loading…
Cancel
Save