未验证 提交 3cc72d67 编写于 作者: T Tanimodori 提交者: GitHub

fix: 更新Schema时默认值不应覆盖已有值,fix #1997 (#2003)

上级 fbcba766
......@@ -230,12 +230,14 @@ export function useFormEvents({
}
const obj: Recordable = {};
const currentFieldsValue = getFieldsValue();
schemas.forEach((item) => {
if (
item.component != 'Divider' &&
Reflect.has(item, 'field') &&
item.field &&
!isNullOrUnDef(item.defaultValue)
!isNullOrUnDef(item.defaultValue) &&
!(item.field in currentFieldsValue)
) {
obj[item.field] = item.defaultValue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册