fix required prefixCls

This commit is contained in:
afc163 2016-02-03 14:00:38 +08:00
parent 51c33b9c51
commit b4c997f016
3 changed files with 4 additions and 4 deletions

View File

@ -116,7 +116,7 @@ class FormItem extends React.Component {
const className = classNames({ const className = classNames({
[this._getLayoutClass(labelCol)]: true, [this._getLayoutClass(labelCol)]: true,
'label-required': required, [`${props.prefixCls}-item-required`]: required,
}); });
return props.label ? ( return props.label ? (

View File

@ -36,7 +36,7 @@ let Demo = React.createClass({
<FormItem <FormItem
label="您的性别:" label="您的性别:"
labelCol={{ span: 6 }} labelCol={{ span: 6 }}
wrapperCol={{ span: 14 }}d> wrapperCol={{ span: 14 }}>
<RadioGroup {...getFieldProps('gender', { initialValue: 'female' })}> <RadioGroup {...getFieldProps('gender', { initialValue: 'female' })}>
<Radio value="male">男的</Radio> <Radio value="male">男的</Radio>
<Radio value="female">女的</Radio> <Radio value="female">女的</Radio>
@ -50,7 +50,7 @@ let Demo = React.createClass({
<Input type="textarea" placeholder="随便写" {...getFieldProps('remark')} /> <Input type="textarea" placeholder="随便写" {...getFieldProps('remark')} />
</FormItem> </FormItem>
<FormItem <FormItem
wrapperCol={{ span: 14, offset: 6 }} > wrapperCol={{ span: 14, offset: 6 }}>
<label> <label>
<Checkbox {...getFieldProps('agreement')} />同意 <Checkbox {...getFieldProps('agreement')} />同意
</label> </label>

View File

@ -11,7 +11,7 @@ label {
} }
} }
.label-required:before { .@{css-prefix}form-item-required:before {
display: inline-block; display: inline-block;
margin-right: 4px; margin-right: 4px;
content: "*"; content: "*";