mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
29 lines
463 B
Markdown
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;
|
|
```
|