ant-design/components/checkbox/demo/group.md

21 lines
373 B
Markdown
Raw Normal View History

2015-12-25 11:56:25 +08:00
# Checkbox 组
2015-12-24 15:03:06 +08:00
- order: 3
方便的生成一个 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);
}
ReactDOM.render(
<CheckboxGroup options={['Apple', 'Pear', 'Orange']} defaultValue={['Apple']} onChange={onChange} />
, mountNode);
2015-12-24 15:03:06 +08:00
````