2015-12-25 11:56:25 +08:00
|
|
|
# Checkbox 组
|
2015-12-24 15:03:06 +08:00
|
|
|
|
|
|
|
- order: 3
|
|
|
|
|
2015-12-25 11:42:13 +08:00
|
|
|
方便的生成一个 Checkbox 组。
|
2015-12-24 15:03:06 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
import { Checkbox } from 'antd';
|
2015-12-24 15:13:23 +08:00
|
|
|
const CheckboxGroup = Checkbox.Group;
|
2015-12-24 15:03:06 +08:00
|
|
|
|
|
|
|
function onChange(checkedValues) {
|
|
|
|
console.log('checked = ', checkedValues);
|
|
|
|
}
|
|
|
|
|
2015-12-25 11:42:13 +08:00
|
|
|
ReactDOM.render(
|
|
|
|
<CheckboxGroup options={['Apple', 'Pear', 'Orange']} defaultValue={['Apple']} onChange={onChange} />
|
2015-12-29 12:08:58 +08:00
|
|
|
, mountNode);
|
2015-12-24 15:03:06 +08:00
|
|
|
````
|