Преглед изворни кода

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

oooplz пре 2 година
родитељ
комит
401fcaf325
1 измењених фајлова са 1 додато и 1 уклоњено
  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;
     }
   }
 }