mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +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
|
||||
>
|
||||
{getFieldDecorator('nickname', {
|
||||
rules: [{ required: true, message: 'Please input your nickname!' }],
|
||||
rules: [{ required: true, message: 'Please input your nickname!', whitespace: true }],
|
||||
})(
|
||||
<Input />
|
||||
)}
|
||||
|
@ -133,6 +133,7 @@ Property | Description | Type | Default Value
|
||||
message | validation error message | 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`
|
||||
whitespace | treat required fields that only contain whitespace as errors | boolean | `false`
|
||||
len | validate an exact length of a field | number | -
|
||||
min | validate a min length of a field | number | -
|
||||
max | validate a max length of a field | number | -
|
||||
|
@ -134,6 +134,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
|
||||
message | 校验文案 | string | -
|
||||
type | 内建校验类型,[可选项](https://github.com/yiminghe/async-validator#type) | string | 'string'
|
||||
required | 是否必选 | boolean | `false`
|
||||
whitespace | 必选时,空格是否会被视为错误 | boolean | `false`
|
||||
len | 字段长度 | number | -
|
||||
min | 最小长度 | number | -
|
||||
max | 最大长度 | number | -
|
||||
|
Loading…
Reference in New Issue
Block a user