You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
635 B
27 lines
635 B
import React from 'react';
|
|
import RcTree from 'rc-tree';
|
|
import animation from '../_util/openAnimation';
|
|
|
|
export default class Tree extends React.Component {
|
|
static TreeNode = RcTree.TreeNode;
|
|
|
|
static defaultProps = {
|
|
prefixCls: 'ant-tree',
|
|
checkable: false,
|
|
showIcon: false,
|
|
openAnimation: animation,
|
|
}
|
|
|
|
render() {
|
|
const props = this.props;
|
|
let checkable = props.checkable;
|
|
if (checkable) {
|
|
checkable = <span className={`${props.prefixCls}-checkbox-inner`}></span>;
|
|
}
|
|
return (
|
|
<RcTree {...props} checkable={checkable}>
|
|
{this.props.children}
|
|
</RcTree>
|
|
);
|
|
}
|
|
}
|
|
|