fix: update form context to use rules instead of defaultValue for field validation

pull/56/head
chenminjie 2024-12-03 18:09:15 +08:00
parent c6d08a4d58
commit c77fb9c84a
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ export function useFormInitial(
if (Reflect.has(item, 'defaultValue')) {
set(initialValues, item.fieldName, item.defaultValue);
} else if (item.rules && !isString(item.rules)) {
set(zodObject, item.fieldName, item.defaultValue);
set(zodObject, item.fieldName, item.rules);
}
});