demo1修改

This commit is contained in:
wh 2018-01-24 13:52:38 +08:00
parent 6c5f642a63
commit 8a2db06fe5
5 changed files with 30 additions and 26 deletions

View File

@ -1,7 +1,7 @@
/**
*
* @title Tree基本使用事例
* @description 事例涵盖 checkbox如何选择disable状态和部分选择状态
* @description 事例涵盖 checkbox如何选择disable状态和部分选择状态checkStrictly为true时子节点与父节点的选择情况都不会影响到对方
*
*/
@ -24,25 +24,27 @@ class Demo1 extends Component {
this.state = {
defaultExpandedKeys: keys,
defaultSelectedKeys: keys,
defaultCheckedKeys: keys,
checkedKeys: {checked:keys},
};
}
onSelect(info) {
console.log('selected', info);
}
onCheck(info) {
console.log('onCheck', info);
onCheck = (checkedKeys) => {
let self = this;
console.log('onCheck', checkedKeys);
const cks = {
checked: checkedKeys.checked || checkedKeys,
};
this.setState({checkedKeys:cks});
}
render() {
let checkedKeys = {
checked:this.state.defaultCheckedKeys
}
return (
<Tree className="myCls" showLine checkable
defaultExpandedKeys={this.state.defaultExpandedKeys}
defaultSelectedKeys={this.state.defaultSelectedKeys}
// defaultCheckedKeys = {this.state.defaultCheckedKeys}
// checkedKeys={checkedKeys}
checkedKeys = {this.state.checkedKeys}
checkStrictly
onSelect={this.onSelect} onCheck={this.onCheck}

File diff suppressed because one or more lines are too long

30
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "bee-tree",
"version": "1.0.3",
"version": "1.0.4",
"description": "Tree ui component for react",
"keywords": [
"react",