Last active
April 1, 2019 14:16
-
-
Save lazyTai/4649b3c9c18d5a0b689fba8db09e3d83 to your computer and use it in GitHub Desktop.
rcc react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import style from './basisiStyle.css' | |
import {Input, Form, Select, Icon, Radio, DatePicker, Button} from 'antd' | |
const FormItem = Form.Item; | |
const Option = Select.Option | |
const RadioGroup = Radio.Group; | |
class Basics extends React.Component { | |
render() { | |
const {getFieldDecorator, getFieldsError, getFieldError, isFieldTouched} = this.props.form; | |
return ( | |
<div className={style.basisic}> | |
<FormItem | |
label={"姓氏"} | |
> | |
{getFieldDecorator('beforeName', { | |
rules: [{required: true, message: 'Please input your username!'}], | |
})( | |
<Input prefix={<Icon type="user"/>} placeholder="Username" style={{height: 40, width: 250}}/> | |
)} | |
</FormItem> | |
<FormItem | |
label={"名字"} | |
> | |
{getFieldDecorator('lastName', { | |
rules: [{required: true, message: 'Please input your username!'}], | |
})( | |
<Input prefix={<Icon type="user"/>} placeholder="Username" style={{height: 40, width: 250}}/> | |
)} | |
</FormItem> | |
<FormItem | |
label={"邮箱"} | |
> | |
{getFieldDecorator('email', { | |
rules: [{required: true, message: 'Please input your username!'}], | |
})( | |
<Input prefix={<Icon type="user"/>} placeholder="Username" style={{height: 40, width: 250}}/> | |
)} | |
</FormItem> | |
<FormItem | |
label={"性别"} | |
> | |
{getFieldDecorator('gener', { | |
initialValue: 1, | |
rules: [{required: true, message: 'Please input your username!'}], | |
})( | |
<RadioGroup> | |
<Radio value={1}>男</Radio> | |
<Radio value={2}>女</Radio> | |
</RadioGroup> | |
)} | |
</FormItem> | |
<FormItem | |
label={"出生年月"} | |
> | |
{getFieldDecorator('birthday', { | |
// rules: [{required: true, message: 'Please input your username!'}], | |
})( | |
<DatePicker size={"large"}/> | |
)} | |
</FormItem> | |
<Button className={style.btn}>确认更新</Button> | |
</div> | |
); | |
} | |
} | |
const WrappedHorizontalLoginForm = Form.create()(Basics); | |
export default WrappedHorizontalLoginForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment