浏览代码

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;
     }
   }
 }