We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e222e65 commit 423b8a7Copy full SHA for 423b8a7
packages/@core/ui-kit/form-ui/src/use-form-context.ts
@@ -51,11 +51,8 @@ export function useFormInitial(
51
} else if (item.rules && !isString(item.rules)) {
52
// 检查规则是否适合提取默认值
53
const customDefaultValue = getCustomDefaultValue(item.rules);
54
- if (customDefaultValue === undefined) {
55
- // 否则将规则添加到 zodObject
56
- zodObject[item.fieldName] = item.rules;
57
- } else {
58
- // 如果有自定义默认值,直接使用
+ zodObject[item.fieldName] = item.rules;
+ if (customDefaultValue !== undefined) {
59
initialValues[item.fieldName] = customDefaultValue;
60
}
61
0 commit comments