mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix: fix field array type (#99)
This commit is contained in:
parent
c75f92d379
commit
ba063ae856
@ -16,7 +16,7 @@ export function toFieldArray<TValue>(model: FieldArrayModel<TValue>): FieldArray
|
||||
onChange: (value) => {
|
||||
model.value = value;
|
||||
},
|
||||
map: <T = any>(cb: (f: Field, index: number) => T) =>
|
||||
map: <T = any>(cb: (f: Field<TValue>, index: number) => T) =>
|
||||
model.map<T>((f, index) => cb(toField(f), index)),
|
||||
append: (value) => toField<TValue>(model.append(value)),
|
||||
/**
|
||||
|
||||
@ -72,7 +72,7 @@ export interface FieldArray<TFieldValue extends FieldValue = FieldValue>
|
||||
* Same as native Array.map, the first param of the callback function is the child field of this FieldArray.
|
||||
* @param cb callback function
|
||||
*/
|
||||
map: <T = any>(cb: (f: Field, index: number) => T) => T[];
|
||||
map: <T = any>(cb: (f: Field<TFieldValue>, index: number) => T) => T[];
|
||||
/**
|
||||
* Append a value at the end of the array, it will create a new Field for this value as well.
|
||||
* @param value the value to append
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user