需求:
进入页面请求接口,把这个值渲染到表单中的input上
const [indicators, setIndicators] = useState<any>({}) const [form] = Form.useForm(); useEffect(() => { form.setFieldsValue(indicators) }, [indicators]) <Form form={form} > 或者直接在formitem标签上写 initialValue = “xxx” 标签:const,form,表单,输入框,indicators,antD,默认值 From: https://www.cnblogs.com/huchong-bk/p/17024819.html