Skip to content

Commit

Permalink
feat: form-render组件新增onchange方法 (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuo committed May 24, 2024
1 parent 431db80 commit 0e1c7e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vantui/src/form-render/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const clsPrefix = 'van'
let initIndex = 0

function FormRender<T>(props: IFormRenderProps<T>) {
const { config, defaultValues, form } = props
const { config, defaultValues, form, onChange } = props
const [componentIndex] = useState(initIndex++)

const renderItem = useCallback(
Expand Down Expand Up @@ -54,6 +54,7 @@ function FormRender<T>(props: IFormRenderProps<T>) {
initialValues={_defaultValues || {}}
className={`${clsPrefix}-form-render`}
form={form}
onChange={onChange}
>
{config.map((it, index) => {
return renderItem(it as any, index)
Expand Down

0 comments on commit 0e1c7e4

Please sign in to comment.