ant-design/components/checkbox/demo/basic.md

21 lines
363 B
Markdown
Raw Normal View History

2015-07-15 15:19:24 +08:00
# 基本用法
- order: 0
简单的 checkbox。
---
````jsx
var Checkbox = antd.Checkbox;
var 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
````