update tree demo

This commit is contained in:
afc163 2016-07-13 16:08:10 +08:00
parent 1c87f36dd4
commit 2d0b56a429
3 changed files with 6 additions and 8 deletions

View File

@ -38,11 +38,6 @@ const generateData = (_level, _preKey, _tns) => {
generateData(z);
const Demo = React.createClass({
getDefaultProps() {
return {
multiple: true,
};
},
getInitialState() {
return {
expandedKeys: ['0-0-0', '0-0-1'],
@ -82,7 +77,8 @@ const Demo = React.createClass({
return <TreeNode key={item.key} title={item.key} />;
});
return (
<Tree checkable multiple={this.props.multiple}
<Tree
checkable
onExpand={this.onExpand} expandedKeys={this.state.expandedKeys}
autoExpandParent={this.state.autoExpandParent}
onCheck={this.onCheck} checkedKeys={this.state.checkedKeys}

View File

@ -31,7 +31,7 @@ const Demo = React.createClass({
},
render() {
return (
<Tree className="myCls" showLine multiple checkable
<Tree className="myCls" showLine checkable
defaultExpandedKeys={this.state.defaultExpandedKeys}
defaultSelectedKeys={this.state.defaultSelectedKeys}
defaultCheckedKeys={this.state.defaultCheckedKeys}

View File

@ -99,7 +99,9 @@ const Demo = React.createClass({
return <TreeNode key={item.key} title={item.key} />;
});
return (
<Tree defaultExpandedKeys={this.state.expandedKeys} openAnimation={{}} draggable
<Tree
defaultExpandedKeys={this.state.expandedKeys}
draggable
onDragEnter={this.onDragEnter}
onDrop={this.onDrop}
>