优化FormItemsRenderer
parent
05d152b489
commit
3327ffc2cc
|
|
@ -61,7 +61,7 @@ export interface FormListUniqueProps {
|
|||
/** 删除按钮的文本,默认 '删除' */
|
||||
removeButtonText?: string;
|
||||
/** 表单配置项 */
|
||||
options: (operations: FormListOperations) => FormOption[];
|
||||
options: (field: FormListFieldData, operations: FormListOperations) => FormOption[];
|
||||
/** 点击新增按钮时的默认值 */
|
||||
addDefaultValue?: FormValues;
|
||||
/** 点击新增按钮时插入的索引位置 */
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ const FormItemsRenderer = ({
|
|||
// 获取 listOptions
|
||||
const getListOptions = (listOptions, field, fieldIndex, add, remove, move) => {
|
||||
return typeof listOptions === "function"
|
||||
? listOptions(field, fieldIndex, add, remove, move)
|
||||
? listOptions(field, { field, fieldIndex, add, remove, move })
|
||||
: (listOptions ?? []);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue