Parcourir la source

fix: 空数组覆盖有效数组 (#2687)

oooplz il y a 2 ans
Parent
commit
401fcaf325
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/components/Form/src/hooks/useFormEvents.ts

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

@@ -43,7 +43,7 @@ function tryConstructArray(field: string, values: Recordable = {}): any[] | unde
         set(result, index, values[k.trim()]);
       });
 
-      return result.length ? result : undefined;
+      return result.filter(Boolean).length ? result : undefined;
     }
   }
 }