提交 26d9c64f 编写于 作者: S SimaQ

fix: 修复通 Validator 结合使用输入失焦的问题。

上级 0097b574
......@@ -30,8 +30,9 @@ class FormItem extends React.Component {
}
renderValidateWrapper(children) {
let classes = '';
if (this.props.validateStatus) {
const classes = cx(
classes = cx(
{
'has-feedback': this.props.hasFeedback,
'has-success': this.props.validateStatus === 'success',
......@@ -40,13 +41,12 @@ class FormItem extends React.Component {
'is-validating': this.props.validateStatus === 'validating',
}
);
return (
<div className={classes}>
{children}
</div>
);
}
return children;
return (
<div className={classes}>
{children}
</div>
);
}
renderWrapper(children) {
......
......@@ -74,7 +74,7 @@ ReactDOM.render(
</FormItem>
<FormItem
label="Datepicker 失败:"
label="Datepicker:"
labelCol={{span: 5}}
validateStatus="error">
<Col span="6">
......
......@@ -20,7 +20,7 @@
表单一定会包含表单域,表单域可以是输入控件,标准表单域,标签,下拉菜单,文本域等。
这里我们分别为表单域和输入控件封装了
这里我们分别封装了表单域 `<Form.Item>` 和输入控件 `<Input>`
```html
<Form.Item {...props}>
......@@ -54,8 +54,8 @@
| wrapperCol | 需要为输入控件设置布局样式时,使用该属性,用法同 labelCol | object | | |
| help | 提示信息 | string | | |
| required | 是否必填 | bool | | false |
| hasFeedback | 配合 validateStatus 属性使用,是否展示校验状态图标 | bool | | false |
| validateStatus | 校验状态 | string | 'success' 'warning' 'error' 'validating' | |
| hasFeedback | 配合 validateStatus 属性使用,是否展示校验状态图标 | bool | | false |
| prefixCls | 样式类名,默认为 ant-form,通常您不需要设置 | string | | 'ant-form' |
### Form.ValueMixin
......
......@@ -216,6 +216,9 @@ form {
//== Inline Form
.@{css-prefix}form-inline {
div {
display: inline-block;
}
.@{css-prefix}form-item {
display: inline-block;
margin-right: 10px;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册