细节修改,保持 dom 结构稳定。

This commit is contained in:
SimaQ 2015-10-31 08:43:38 +08:00
parent 26d9c64f4d
commit 1c1bf9945a
3 changed files with 9 additions and 8 deletions

View File

@ -22,11 +22,11 @@ class FormItem extends React.Component {
renderHelp() { renderHelp() {
const prefixCls = this.props.prefixCls; const prefixCls = this.props.prefixCls;
return this.props.help ? ( return (
<div className={prefixClsFn(prefixCls, 'explain')}> <div className={this.props.help ? prefixClsFn(prefixCls, 'explain') : ''}>
{this.props.help} {this.props.help}
</div> </div>
) : null; );
} }
renderValidateWrapper(children) { renderValidateWrapper(children) {
@ -51,11 +51,11 @@ class FormItem extends React.Component {
renderWrapper(children) { renderWrapper(children) {
const wrapperCol = this.props.wrapperCol; const wrapperCol = this.props.wrapperCol;
return wrapperCol ? ( return (
<div className={this._getLayoutClass(wrapperCol)}> <div className={this._getLayoutClass(wrapperCol)}>
{children} {children}
</div> </div>
) : children; );
} }
renderLabel() { renderLabel() {

View File

@ -43,13 +43,13 @@ class Input extends React.Component {
</span> </span>
) : null; ) : null;
return addonBefore || addonAfter ? ( return (
<div className={wrapperClassName}> <div className={(addonBefore || addonAfter) ? wrapperClassName : ''}>
{addonBefore} {addonBefore}
{children} {children}
{addonAfter} {addonAfter}
</div> </div>
) : children; );
} }
renderInput() { renderInput() {

View File

@ -152,6 +152,7 @@
} }
// Reset rounded corners // Reset rounded corners
> div > .@{inputClass}:first-child,
> .@{inputClass}:first-child, > .@{inputClass}:first-child,
&-addon:first-child { &-addon:first-child {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;