优化FormBuilder
parent
2f9f51d114
commit
99091833c9
|
|
@ -9,7 +9,7 @@ import type { FORM_ITEM_RENDER_ENUM } from "../../enum/formItemRender";
|
|||
*/
|
||||
export type FormItemRenderType
|
||||
= | (typeof FORM_ITEM_RENDER_ENUM)[keyof typeof FORM_ITEM_RENDER_ENUM]
|
||||
| ((props: any) => ReactNode);
|
||||
| ((props: { formValues: FormValues; [key: string]: any }) => ReactNode);
|
||||
|
||||
/**
|
||||
* 选项项数据类型
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ const FormItemsRenderer = ({
|
|||
// 支持传入自定义组件
|
||||
if (typeof render === "function") {
|
||||
const CustomComponent = render;
|
||||
return <CustomComponent {...componentProps} />;
|
||||
return <CustomComponent {...componentProps} formValues={getFormValues()} />;
|
||||
}
|
||||
return <Input placeholder={placeholder} {...componentProps} />;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue