fix: username misspelling in the form. (#16398)

* fix normal-login spelling mistake

* fix horizontal-login spelling mistake

* fix index.zh-CN spelling mistake

* fix index.en-US spelling mistake

* update form demo.test.js.snap
This commit is contained in:
HiddenMan 2019-05-01 23:44:22 +08:00 committed by zombieJ
parent 106423f1e7
commit 0350544de1
5 changed files with 13 additions and 13 deletions

View File

@ -1070,7 +1070,7 @@ exports[`renders ./components/form/demo/horizontal-login.md correctly 1`] = `
class="ant-input"
data-__field="[object Object]"
data-__meta="[object Object]"
id="horizontal_login_userName"
id="horizontal_login_username"
placeholder="Username"
type="text"
value=""
@ -1392,7 +1392,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = `
class="ant-input"
data-__field="[object Object]"
data-__meta="[object Object]"
id="normal_login_userName"
id="normal_login_username"
placeholder="Username"
type="text"
value=""

View File

@ -43,15 +43,15 @@ class HorizontalLoginForm extends React.Component {
} = this.props.form;
// Only show error after a field is touched.
const userNameError = isFieldTouched('userName') && getFieldError('userName');
const usernameError = isFieldTouched('username') && getFieldError('username');
const passwordError = isFieldTouched('password') && getFieldError('password');
return (
<Form layout="inline" onSubmit={this.handleSubmit}>
<Form.Item
validateStatus={userNameError ? 'error' : ''}
help={userNameError || ''}
validateStatus={usernameError ? 'error' : ''}
help={usernameError || ''}
>
{getFieldDecorator('userName', {
{getFieldDecorator('username', {
rules: [{ required: true, message: 'Please input your username!' }],
})(
<Input prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} placeholder="Username" />

View File

@ -33,7 +33,7 @@ class NormalLoginForm extends React.Component {
return (
<Form onSubmit={this.handleSubmit} className="login-form">
<Form.Item>
{getFieldDecorator('userName', {
{getFieldDecorator('username', {
rules: [{ required: true, message: 'Please input your username!' }],
})(
<Input prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} placeholder="Username" />

View File

@ -127,11 +127,11 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
```js
{
"userName": {
"username": {
"errors": [
{
"message": "Please input your username!",
"field": "userName"
"field": "username"
}
]
},
@ -150,7 +150,7 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
```js
{
"userName": "username",
"username": "username",
"password": "password",
}
```

View File

@ -129,11 +129,11 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
```js
{
"userName": {
"username": {
"errors": [
{
"message": "Please input your username!",
"field": "userName"
"field": "username"
}
]
},
@ -152,7 +152,7 @@ validateFields(['field1', 'field2'], options, (errors, values) => {
```js
{
"userName": "username",
"username": "username",
"password": "password",
}
```