Explorar el Código

fix: arrayField children props types (#217)

格桑 hace 4 años
padre
commit
ae57436b11
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  1. 11 1
      packages/semi-ui/form/arrayField.tsx

+ 11 - 1
packages/semi-ui/form/arrayField.tsx

@@ -9,7 +9,17 @@ import { ArrayFieldStaff, FormUpdaterContextType } from '@douyinfe/semi-foundati
 export interface ArrayFieldProps {
     initValue?: any[];
     field?: string;
-    children?: ({ }) => React.ReactNode;
+    children?: (props: ArrayFieldChildrenProps) => React.ReactNode;
+}
+
+export interface ArrayFieldChildrenProps {
+    arrayFields: {
+        key: string;
+        field: string;
+        remove: () => void;
+    }[];
+    add: () => void;
+    addWithInitValue: (lineObject: Record<string, any>) => void;
 }
 
 export interface ArrayFieldState {