Browse Source

Merge branch 'develop-1.0.0' into spa-new-design-language

pull/1200/head
Benjy Cui 9 years ago
parent
commit
a749026273
  1. 2
      components/checkbox/Group.jsx
  2. 7
      components/checkbox/demo/group.md

2
components/checkbox/Group.jsx

@ -63,7 +63,7 @@ export default React.createClass({
<div className="ant-checkbox-group">
{
options.map(option =>
<Checkbox disabled={this.props.disabled}
<Checkbox disabled={'disabled' in option ? option.disabled : this.props.disabled}
checked={this.state.value.indexOf(option.value) !== -1}
onChange={this.toggleOption.bind(this, option)}
className="ant-checkbox-group-item" key={option.value}>

7
components/checkbox/demo/group.md

@ -25,12 +25,19 @@ const options = [{
label: '橘',
value: 'Orange',
}];
const optionsWithDisabled = [
{ label: '苹果', value: 'Apple' },
{ label: '梨', value: 'Pear' },
{ label: '橘', value: 'Orange', disabled: false },
];
ReactDOM.render(
<div>
<CheckboxGroup options={plainOptions} defaultValue={['Apple']} onChange={onChange} />
<br />
<CheckboxGroup options={options} defaultValue={['Pear']} onChange={onChange} />
<br />
<CheckboxGroup options={optionsWithDisabled} disabled defaultValue={['Apple']} onChange={onChange} />
</div>
, mountNode);
````

Loading…
Cancel
Save