ant-design/components/checkbox/demo/basic.md
2022-05-21 22:14:15 +08:00

29 lines
463 B
Markdown

---
order: 0
title:
zh-CN: 基本用法
en-US: Basic
---
## zh-CN
简单的 checkbox。
## en-US
Basic usage of checkbox.
```tsx
import { Checkbox } from 'antd';
import type { CheckboxChangeEvent } from 'antd/es/checkbox';
import React from 'react';
const onChange = (e: CheckboxChangeEvent) => {
console.log(`checked = ${e.target.checked}`);
};
const App: React.FC = () => <Checkbox onChange={onChange}>Checkbox</Checkbox>;
export default App;
```