2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 0
|
2016-08-18 11:22:55 +08:00
|
|
|
title:
|
2019-05-07 14:57:32 +08:00
|
|
|
zh-CN: 基本用法
|
|
|
|
en-US: Basic
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-07-15 15:19:24 +08:00
|
|
|
|
2016-08-18 11:22:55 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-07-15 15:19:24 +08:00
|
|
|
简单的 checkbox。
|
|
|
|
|
2016-08-18 11:22:55 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Basic usage of checkbox.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Checkbox } from 'antd';
|
2022-05-19 09:46:26 +08:00
|
|
|
import type { CheckboxChangeEvent } from 'antd/es/checkbox';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React from 'react';
|
2015-10-28 20:55:49 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const onChange = (e: CheckboxChangeEvent) => {
|
2016-02-17 18:04:42 +08:00
|
|
|
console.log(`checked = ${e.target.checked}`);
|
2022-05-19 09:46:26 +08:00
|
|
|
};
|
2015-07-15 15:19:24 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => <Checkbox onChange={onChange}>Checkbox</Checkbox>;
|
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|