Przeglądaj źródła

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

shizhongming 2 lat temu
rodzic
commit
ed9571842a
1 zmienionych plików z 1 dodań i 1 usunięć
  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)) {