Closed JoelynZhou closed 11 months ago
最小复现 demo: https://codesandbox.io/s/youthful-estrela-qpmwr5?file=/App.tsx
import React from 'react'; import FormRender, { useForm } from 'form-render'; const schema = { type: 'object', displayType: 'row', properties: { input1: { title: '输入框 A', type: 'string', placeholder: '给输入框 B 赋值', default: "1", }, input2: { title: '输入框 B', type: 'string', disabled: true }, }, }; export default () => { const form = useForm(); const values = form.getValues(); console.log("values", values); const watch = { input1: val => { form.setValueByPath('input2', val); } }; return ( <FormRender form={form} schema={schema} watch={watch} labelWidth={200} maxWidth={400} /> ); };
打印时机不对
最小复现 demo: https://codesandbox.io/s/youthful-estrela-qpmwr5?file=/App.tsx