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