mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
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:
parent
106423f1e7
commit
0350544de1
@ -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=""
|
||||
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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",
|
||||
}
|
||||
```
|
||||
|
@ -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",
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user