mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
update checkbox demo
This commit is contained in:
parent
687493e5a9
commit
d1cfcc83db
@ -9,8 +9,8 @@
|
||||
````jsx
|
||||
var Checkbox = antd.Checkbox;
|
||||
var container = document.getElementById('components-checkbox-demo-basic');
|
||||
function onChange(checked){
|
||||
console.log('checked = ' + checked);
|
||||
function onChange(e){
|
||||
console.log('checked = ' + e.target.checked);
|
||||
}
|
||||
|
||||
React.render(<label><Checkbox defaultChecked={false} onChange={onChange}/> checkbox</label>, container);
|
||||
|
@ -45,8 +45,7 @@ var App = React.createClass({
|
||||
this.setState({disabled:!this.state.disabled});
|
||||
},
|
||||
onChange(checked){
|
||||
console.log('checked = ',checked);
|
||||
this.setState({checked:checked});
|
||||
console.log('checked = ',e.target.checked);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -20,4 +20,4 @@
|
||||
|-----------|------------------------------------------|------------|-------|--------|
|
||||
| checked | 指定当前是否选中 | boolean | | false |
|
||||
| defaultChecked | 初始是否选中 | boolean | | false |
|
||||
| onChange | 变化时回调函数 | Function(checked:boolean) | | |
|
||||
| onChange | 变化时回调函数 | Function(e:Event) | | |
|
||||
|
Loading…
Reference in New Issue
Block a user