mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
e7aa014c31
* docs: init * chore: all types * docs: faq * chore: fix lint
32 lines
773 B
TypeScript
32 lines
773 B
TypeScript
import React from 'react';
|
|
import { Checkbox, Col, Row } from 'antd';
|
|
import type { GetProp } from 'antd';
|
|
|
|
const onChange: GetProp<typeof Checkbox.Group, 'onChange'> = (checkedValues) => {
|
|
console.log('checked = ', checkedValues);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Checkbox.Group style={{ width: '100%' }} 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>
|
|
);
|
|
|
|
export default App;
|