Browse Source

improve FormItem colon (#2311)

pull/2453/head
afc163 8 years ago
parent
commit
497cc1f65a
  1. 3
      components/form/FormItem.tsx
  2. 2
      components/form/style/index.less

3
components/form/FormItem.tsx

@ -9,6 +9,7 @@ export default class FormItem extends React.Component {
static defaultProps = { static defaultProps = {
hasFeedback: false, hasFeedback: false,
prefixCls: 'ant-form', prefixCls: 'ant-form',
colon: true,
}; };
static propTypes = { static propTypes = {
@ -197,7 +198,7 @@ export default class FormItem extends React.Component {
const itemClassName = { const itemClassName = {
[`${prefixCls}-item`]: true, [`${prefixCls}-item`]: true,
[`${prefixCls}-item-with-help`]: !!this.getHelpMsg(), [`${prefixCls}-item-with-help`]: !!this.getHelpMsg(),
[`${prefixCls}-no-colon`]: !this.props.colon, [`${prefixCls}-item-no-colon`]: !props.colon,
[`${props.className}`]: !!props.className, [`${props.className}`]: !!props.className,
}; };

2
components/form/style/index.less

@ -101,7 +101,7 @@ input[type="checkbox"] {
margin: 4px 0; margin: 4px 0;
} }
&.@{form-prefix-cls}-no-colon > label:after { &-no-colon &-label label:after {
content: " "; content: " ";
} }
} }

Loading…
Cancel
Save