update checkbox demo

This commit is contained in:
yiminghe 2015-07-16 12:28:50 +08:00
parent 687493e5a9
commit d1cfcc83db
3 changed files with 4 additions and 5 deletions

View File

@ -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}/> &nbsp; &nbsp; checkbox</label>, container);

View File

@ -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);
}
});

View File

@ -20,4 +20,4 @@
|-----------|------------------------------------------|------------|-------|--------|
| checked | 指定当前是否选中 | boolean | | false |
| defaultChecked | 初始是否选中 | boolean | | false |
| onChange | 变化时回调函数 | Function(checked:boolean) | | |
| onChange | 变化时回调函数 | Function(e:Event) | | |