antd表单使用笔记
import { Form } from 'antd'
export default const App=()=>{
const form = Form.useForm();
//提交表单
const onFinish = (val) => {
//val可以拿到表单内容
console.log(val);
};
<Form onFinish={onFinish} layout="horizontal" form={form} >
<Form.Item label="名称" name="name" rules={[{ required: true, message: '不填不行啊' }]}>
<Input ref={input} />
</Form.Item>
</Form>
}
标签:const,Form,val,笔记,表单,Antd
From: https://www.cnblogs.com/melongs/p/16861844.html