We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
函数式组件
const AppletModal: React.FC<any> = (props) => { const [form] = Form.useForm(); render(){ return( <Form ref={form}></Form> ) } }
class类组件
import { FormInstance } from 'antd/lib/form'; class AppletEdit extends React.Component<any, any> { form: any = React.createRef(); form = React.createRef<FormInstance>(); render(){ return( <Form ref={this.form}></Form> ) } }
form.setFieldsValue({ bankIdList: options.map((v) => { return v.value; }) })
class组件
this.form.current.setFieldsValue({ bankIdList: options.map((v) => { return v.value; }) })
返回一个json对象 this.form.current.getFieldsValue()
this.form.current.getFieldsValue()
this.form.current.setFieldsValue({ xxx: xxx })
其他相关FormInstance说明及使用方法文档
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1、获取表单实例
2、form表单实例方法
给表单属性赋值 ref
3、打印 console.log(form)
1)获取所有表单属性值
返回一个json对象
this.form.current.getFieldsValue()
2) 设置表单属性值
this.form.current.setFieldsValue({ xxx: xxx })
更多
其他相关FormInstance说明及使用方法文档
The text was updated successfully, but these errors were encountered: