fix form demo style

This commit is contained in:
afc163 2016-01-23 16:18:22 +08:00
parent fc5883d7ec
commit cb6224df4b
4 changed files with 15 additions and 12 deletions

View File

@ -35,7 +35,7 @@ class BasicDemo extends React.Component {
handleSubmit(e) {
e.preventDefault();
this.props.form.validateFields(function(errors, values) {
this.props.form.validateFields((errors, values) => {
if (!!errors) {
console.log('Errors in form!!!');
return;
@ -49,7 +49,7 @@ class BasicDemo extends React.Component {
if (!value) {
callback();
} else {
setTimeout(function () {
setTimeout(() => {
if (value === 'JasonWood') {
callback([new Error('抱歉,该用户名已被占用。')]);
} else {

View File

@ -30,7 +30,7 @@ let Demo = React.createClass({
handleSubmit(e) {
e.preventDefault();
this.props.form.validateFields(function(errors, values) {
this.props.form.validateFields((errors, values) => {
if (!!errors) {
console.log('Errors in form!!!');
return;
@ -172,12 +172,17 @@ let Demo = React.createClass({
</Col>
</Row>
<Row>
<Col span="18">
<FormItem
wrapperCol={{span: 12, offset: 6}}>
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
&nbsp;&nbsp;&nbsp;
<Button type="ghost" onClick={this.handleReset}>重置</Button>
</FormItem>
</Col>
<Col span="6" />
</Row>
</Form>
);
}

View File

@ -23,7 +23,7 @@ let Demo = React.createClass({
handleSubmit(e) {
e.preventDefault();
this.props.form.validateFields(function(errors, values) {
this.props.form.validateFields((errors, values) => {
if (!!errors) {
console.log('Errors in form!!!');
return;
@ -129,7 +129,6 @@ let Demo = React.createClass({
label="8~12间的质数"
labelCol={{span: 7}}
wrapperCol={{span: 12}}
hasFeedback
id="primeNumber"
options={{
rules: [{ validator: this.checkPrime }],

View File

@ -5,7 +5,6 @@
.@{radio-group-prefix-cls} {
display: inline-block;
vertical-align: middle;
label {
margin-right: 16px;
}