2015-08-03 16:07:21 +08:00
|
|
|
import React from 'react';
|
2016-03-21 09:22:14 +08:00
|
|
|
import RcTree from 'rc-tree';
|
2015-08-25 11:11:21 +08:00
|
|
|
import animation from '../common/openAnimation';
|
2015-08-18 16:03:13 +08:00
|
|
|
|
2016-03-21 09:22:14 +08:00
|
|
|
export default class Tree extends React.Component {
|
2015-08-03 16:07:21 +08:00
|
|
|
render() {
|
2015-08-19 12:18:10 +08:00
|
|
|
const props = this.props;
|
|
|
|
let checkable = props.checkable;
|
|
|
|
if (checkable) {
|
|
|
|
checkable = <span className={`${props.prefixCls}-checkbox-inner`}></span>;
|
|
|
|
}
|
2016-01-07 14:21:29 +08:00
|
|
|
return (
|
2016-03-21 09:22:14 +08:00
|
|
|
<RcTree {...props} checkable={checkable}>
|
2016-01-07 14:21:29 +08:00
|
|
|
{this.props.children}
|
2016-03-21 09:22:14 +08:00
|
|
|
</RcTree>
|
2016-01-07 14:21:29 +08:00
|
|
|
);
|
2015-08-03 16:07:21 +08:00
|
|
|
}
|
2016-03-21 09:22:14 +08:00
|
|
|
}
|
2015-08-18 16:03:13 +08:00
|
|
|
|
2016-03-21 09:22:14 +08:00
|
|
|
Tree.defaultProps = {
|
|
|
|
prefixCls: 'ant-tree',
|
|
|
|
checkable: false,
|
|
|
|
showIcon: false,
|
|
|
|
openAnimation: animation,
|
|
|
|
};
|
|
|
|
|
|
|
|
Tree.TreeNode = RcTree.TreeNode;
|