demo1修改
This commit is contained in:
parent
6c5f642a63
commit
8a2db06fe5
|
@ -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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-tree",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "Tree ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
Loading…
Reference in New Issue