Browse Source

fix: arrayField addWithInitValue params type define

pointhalo 2 years ago
parent
commit
31adb42c54
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/semi-ui/form/arrayField.tsx

+ 2 - 2
packages/semi-ui/form/arrayField.tsx

@@ -137,11 +137,11 @@ class ArrayFieldComponent extends Component<ArrayFieldProps, ArrayFieldState> {
         this.setState({ keys });
     }
 
-    addWithInitValue(lineObject: Record<string, any>) {
+    addWithInitValue(rowVal: Record<string, any> | string) {
         const updater = this.context;
         const { field } = this.props;
         const newArrayFieldVal = updater.getValue(field) ? updater.getValue(field).slice() : [];
-        newArrayFieldVal.push(lineObject);
+        newArrayFieldVal.push(rowVal);
         updater.updateStateValue(field, newArrayFieldVal, {});
         updater.updateArrayField(field, { updateKey: new Date().valueOf() });
     }