优化FormItemsRenderer类型

master
LiuJiaNan 2025-10-30 11:18:16 +08:00
parent f13fb9ec86
commit 2b2cd0e768
1 changed files with 15 additions and 1 deletions

View File

@ -4,12 +4,26 @@ import type { NamePath } from "rc-field-form/lib/interface";
import type { FC, ReactNode } from "react";
import type { FORM_ITEM_RENDER_ENUM } from "../../enum/formItemRender";
/**
*
*/
export interface CustomRenderProps {
/** 表单当前值 */
formValues: FormValues;
/** 字段值 */
value: any;
/** 值变化回调 */
onChange: (value: any) => void;
/** 其他属性 */
[key: string]: any;
}
/**
*
*/
export type FormItemRenderType
= | (typeof FORM_ITEM_RENDER_ENUM)[keyof typeof FORM_ITEM_RENDER_ENUM]
| ((props: { formValues: FormValues; value: any; onChange: (value: any) => void; [key: string]: any }) => ReactNode);
| ((props: CustomRenderProps) => ReactNode);
/**
*