diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index b1ac4660f2c082fcd6dffebf2b61c5b8830b441f..724bbabae63f5a760f83b2b2743e4edfa13e94fa 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -108,6 +108,7 @@ class FormItem extends React.Component { const itemClassName = { [`${prefixCls}-item`]: true, [`${prefixCls}-item-compact`]: this._isCompact(props.children), + [`${prefixCls}-item-with-help`]: !!props.help, }; return ( diff --git a/components/form/demo/mix.md b/components/form/demo/mix.md index 6ecfd53f40f96ef9c7acdb046b0471d99cd499d5..64ee51e6267d78687f092acfb2c16bb8a0a8146c 100644 --- a/components/form/demo/mix.md +++ b/components/form/demo/mix.md @@ -120,13 +120,13 @@ const Demo = React.createClass({ + wrapperCol={{span: 16}} + help="提示信息要长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长长"> -

仅支持上传一张。

diff --git a/style/components/form.less b/style/components/form.less index 5fb75dc1c3c52b79d606d2e7e7dcaceb01ffa3fd..8a9c884def8e55f98bb2b9da9a9552a39ffdd0cb 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -71,6 +71,10 @@ input[type="checkbox"] { margin-bottom: @form-item-margin-bottom; color: #666; + &.@{css-prefix}form-item-with-help { + margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base; + } + > label { color: @label-color; text-align: right; @@ -104,10 +108,7 @@ input[type="checkbox"] { } .@{css-prefix}form-explain { - position: absolute; - font-size: @font-size-base; - line-height: @line-height-base; - bottom: -@line-height-computed; + float: left; }