2015-07-15 15:19:24 +08:00
|
|
|
# 基本用法
|
|
|
|
|
|
|
|
- order: 0
|
|
|
|
|
|
|
|
简单的 checkbox。
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Checkbox } from 'antd';
|
|
|
|
const container = document.getElementById('components-checkbox-demo-basic');
|
|
|
|
|
2015-07-16 13:36:04 +08:00
|
|
|
function onChange(e) {
|
2015-07-16 12:28:50 +08:00
|
|
|
console.log('checked = ' + e.target.checked);
|
2015-07-15 15:19:24 +08:00
|
|
|
}
|
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(<label>
|
2015-07-17 11:06:38 +08:00
|
|
|
<Checkbox defaultChecked={false} onChange={onChange} />
|
|
|
|
Checkbox
|
2015-07-16 12:27:04 +08:00
|
|
|
</label>, container);
|
2015-07-15 15:19:24 +08:00
|
|
|
````
|