优化FormItemsRenderer

master
LiuJiaNan 2025-12-23 16:48:21 +08:00
parent 05d152b489
commit 3327ffc2cc
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ export interface FormListUniqueProps {
/** 删除按钮的文本,默认 '删除' */
removeButtonText?: string;
/** 表单配置项 */
options: (operations: FormListOperations) => FormOption[];
options: (field: FormListFieldData, operations: FormListOperations) => FormOption[];
/** 点击新增按钮时的默认值 */
addDefaultValue?: FormValues;
/** 点击新增按钮时插入的索引位置 */

View File

@ -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 ?? []);
};