优化FormBuilder

master
LiuJiaNan 2025-10-29 09:59:53 +08:00
parent 2f9f51d114
commit 99091833c9
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import type { FORM_ITEM_RENDER_ENUM } from "../../enum/formItemRender";
*/ */
export type FormItemRenderType export type FormItemRenderType
= | (typeof FORM_ITEM_RENDER_ENUM)[keyof typeof FORM_ITEM_RENDER_ENUM] = | (typeof FORM_ITEM_RENDER_ENUM)[keyof typeof FORM_ITEM_RENDER_ENUM]
| ((props: any) => ReactNode); | ((props: { formValues: FormValues; [key: string]: any }) => ReactNode);
/** /**
* *

View File

@ -248,7 +248,7 @@ const FormItemsRenderer = ({
// 支持传入自定义组件 // 支持传入自定义组件
if (typeof render === "function") { if (typeof render === "function") {
const CustomComponent = render; const CustomComponent = render;
return <CustomComponent {...componentProps} />; return <CustomComponent {...componentProps} formValues={getFormValues()} />;
} }
return <Input placeholder={placeholder} {...componentProps} />; return <Input placeholder={placeholder} {...componentProps} />;
} }