From 147e06a83731c3fcbec5513fa8583ee92409106f Mon Sep 17 00:00:00 2001 From: yeliex Date: Sat, 9 Jul 2016 15:10:07 +0800 Subject: [PATCH] Add `colon` props to Form (#2311) --- components/form/FormItem.tsx | 2 ++ components/form/style/index.less | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index d7a10dcdfb..2e2c554504 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -20,6 +20,7 @@ export default class FormItem extends React.Component { className: React.PropTypes.string, id: React.PropTypes.string, children: React.PropTypes.node, + colon: React.PropTypes.bool } static contextTypes = { @@ -204,6 +205,7 @@ export default class FormItem extends React.Component { 'ant-row': true, [`${prefixCls}-item`]: true, [`${prefixCls}-item-with-help`]: !!this.getHelpMsg(), + [`${prefixCls}-no-colon`]: !this.props.colon, [`${props.className}`]: !!props.className, }; diff --git a/components/form/style/index.less b/components/form/style/index.less index 116e4d8aec..c50d292991 100644 --- a/components/form/style/index.less +++ b/components/form/style/index.less @@ -97,6 +97,10 @@ input[type="checkbox"] { .ant-switch { margin: 4px 0; } + + &.@{form-prefix-cls}-no-colon > label:after { + content: " "; + } } .@{form-prefix-cls}-explain {