Unverified 提交 3cc72d67 作者: 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 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论