1import React from 'react';
2
3import { Form, Input, Button } from 'antd';
4
5const FormItem = Form.Item;
6
7class CustomForm extends React.Component {
8
9
10 handleFormSubmit = (values) => {
11 const title = values.title;
12 const content = values.content;
13 console.log(title, content);
14};
15
16 render(){
17 return (
18 <div>
19 <Form onFinish={(values) => this.handleFormSubmit(values)}>
20
21 <FormItem label="Title" name="title">
22 <Input placeholder="Put a title here" />
23 </FormItem>
24
25 <FormItem label="Content" name="content">
26 <Input placeholder="Enter some content ..." />
27 </FormItem>
28
29 <FormItem >
30 <Button type="primary" htmlType="submit">Submit</Button>
31 </FormItem>
32 </Form>
33 </div>
34 );
35 }
36}
37
38export default CustomForm;
39