函数式组件
代码语言:javascript复制import { Modal, Form, Input, Button, Space } from 'antd';
const [form] = Form.useForm();
form.resetFields();
<Form {...layout} form={form} name="control-ref" onFinish={onFinish}></Form>
class类组件
代码语言:javascript复制import { FormInstance } from 'antd/lib/form';
formRef = React.createRef<FormInstance>();
this.formRef.current.submit()
<Form {...layout} ref={this.formRef} onFinish={this.onFinish} >
</Form>
实体类具备的方法和属性