ant-design/components/checkbox/demo/layout.md
Benjy Cui eb9e19be1f feat: make Checkbox work in Checkbox.Group, close: #5645 (#5714)
* refactor: simplify Radio's code

* feat: make Checkbox work in Checkbox.Group, close: #5645

* test: add snapshot
2017-04-14 16:20:09 +08:00

817 B

order title debug
5
zh-CN en-US
布局 Use with Grid
true

zh-CN

Checkbox.Group 内嵌 Checkbox 并与 Grid 组件一起使用,可以实现灵活的布局。

en-US

We can use Checkbox and Grid in Checkbox.Group, to implement complex layout.

import { Checkbox, Row, Col } from 'antd';

function onChange(checkedValues) {
  console.log('checked = ', checkedValues);
}

ReactDOM.render(
  <Checkbox.Group onChange={onChange}>
    <Row>
      <Col span={8}><Checkbox value="A">A</Checkbox></Col>
      <Col span={8}><Checkbox value="B">B</Checkbox></Col>
      <Col span={8}><Checkbox value="C">C</Checkbox></Col>
      <Col span={8}><Checkbox value="D">D</Checkbox></Col>
      <Col span={8}><Checkbox value="E">E</Checkbox></Col>
    </Row>
  </Checkbox.Group>,
  mountNode
);