parent
92954fb692
commit
f27b3eb43a
@ -1,17 +1,41 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { Form } from 'antd';
|
||||
import connect from 'react-redux';
|
||||
import { Form, Input, Button } from 'antd';
|
||||
|
||||
const FormItem = Form.Item;
|
||||
class EditTab extends PureComponent {
|
||||
|
||||
handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
this.props.form.validateFieldsAndScroll((err, value) => {
|
||||
if (!err) {
|
||||
console.log(value);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
render () {
|
||||
const { form } = this.props;
|
||||
const { getFieldDecorator } = form;
|
||||
return (
|
||||
<div className={'editor_area'}>
|
||||
|
||||
<Form onSubmit={this.handleSubmit}>
|
||||
<FormItem label="任务名称">
|
||||
{ getFieldDecorator('name', {
|
||||
rules: [
|
||||
{
|
||||
required: true, message: '任务名称不能为空'
|
||||
}
|
||||
]
|
||||
})(<Input placeholder="请输入任务名称" />)}
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Button htmlType="submit">提交</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// export default connect()(EditTab);
|
||||
export default EditTab;
|
||||
const EditTabForm = Form.create()(EditTab);
|
||||
export default EditTabForm;
|
||||
|
Loading…
Reference in new issue