ant-design/components/tree/index.jsx

28 lines
636 B
React
Raw Normal View History

2015-08-03 16:07:21 +08:00
import React from 'react';
import RcTree from 'rc-tree';
2015-08-25 11:11:21 +08:00
import animation from '../common/openAnimation';
export default class Tree extends React.Component {
static TreeNode = RcTree.TreeNode;
static defaultProps = {
prefixCls: 'ant-tree',
checkable: false,
showIcon: false,
openAnimation: animation,
}
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>;
}
return (
<RcTree {...props} checkable={checkable}>
{this.props.children}
</RcTree>
);
2015-08-03 16:07:21 +08:00
}
}