Explorar o código

fix(Form组件): 修复form组件setFieldsValue,setFieldsValue({date: dayjs() }) 会报错问题

shizhongming %!s(int64=2) %!d(string=hai) anos
pai
achega
ed9571842a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/components/Form/src/hooks/useFormEvents.ts

+ 1 - 1
src/components/Form/src/hooks/useFormEvents.ts

@@ -90,7 +90,7 @@ export function useFormEvents({
 
       // 0| '' is allow
       if (hasKey || !!constructValue) {
-        const fieldValue = constructValue || value;
+        const fieldValue = constructValue && !isFunction(constructValue) ? constructValue : value;
         // time type
         if (itemIsDateType(key)) {
           if (Array.isArray(fieldValue)) {