fix form demo style

pull/922/head
afc163 9 years ago
parent fc5883d7ec
commit cb6224df4b

@ -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 {

@ -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>
<FormItem
wrapperCol={{span: 12, offset: 6}}>
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
&nbsp;&nbsp;&nbsp;
<Button type="ghost" onClick={this.handleReset}>重置</Button>
</FormItem>
<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>
);
}

@ -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 }],

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

Loading…
Cancel
Save