mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 05:29:37 +08:00
fix whitespace required, close #5418
This commit is contained in:
parent
847515be3d
commit
93ec71ea58
@ -164,7 +164,7 @@ class RegistrationForm extends React.Component {
|
|||||||
hasFeedback
|
hasFeedback
|
||||||
>
|
>
|
||||||
{getFieldDecorator('nickname', {
|
{getFieldDecorator('nickname', {
|
||||||
rules: [{ required: true, message: 'Please input your nickname!' }],
|
rules: [{ required: true, message: 'Please input your nickname!', whitespace: true }],
|
||||||
})(
|
})(
|
||||||
<Input />
|
<Input />
|
||||||
)}
|
)}
|
||||||
|
@ -133,6 +133,7 @@ Property | Description | Type | Default Value
|
|||||||
message | validation error message | string | -
|
message | validation error message | string | -
|
||||||
type | built-in validation type, [available options](https://github.com/yiminghe/async-validator#type) | string | 'string'
|
type | built-in validation type, [available options](https://github.com/yiminghe/async-validator#type) | string | 'string'
|
||||||
required | indicates whether field is required | boolean | `false`
|
required | indicates whether field is required | boolean | `false`
|
||||||
|
whitespace | treat required fields that only contain whitespace as errors | boolean | `false`
|
||||||
len | validate an exact length of a field | number | -
|
len | validate an exact length of a field | number | -
|
||||||
min | validate a min length of a field | number | -
|
min | validate a min length of a field | number | -
|
||||||
max | validate a max length of a field | number | -
|
max | validate a max length of a field | number | -
|
||||||
|
@ -134,6 +134,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
|||||||
message | 校验文案 | string | -
|
message | 校验文案 | string | -
|
||||||
type | 内建校验类型,[可选项](https://github.com/yiminghe/async-validator#type) | string | 'string'
|
type | 内建校验类型,[可选项](https://github.com/yiminghe/async-validator#type) | string | 'string'
|
||||||
required | 是否必选 | boolean | `false`
|
required | 是否必选 | boolean | `false`
|
||||||
|
whitespace | 必选时,空格是否会被视为错误 | boolean | `false`
|
||||||
len | 字段长度 | number | -
|
len | 字段长度 | number | -
|
||||||
min | 最小长度 | number | -
|
min | 最小长度 | number | -
|
||||||
max | 最大长度 | number | -
|
max | 最大长度 | number | -
|
||||||
|
Loading…
Reference in New Issue
Block a user