ant-design/components/tree/index.jsx
Bruce Mitchener eaae43abdd More ES2015 classes.
This covers Carousel, InputNumber, Select, Slider, Switch, TreeSelect
and Tree.
2016-03-21 08:26:05 +07:00

28 lines
619 B
JavaScript

import React from 'react';
import RcTree from 'rc-tree';
import animation from '../common/openAnimation';
export default class Tree extends React.Component {
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>
);
}
}
Tree.defaultProps = {
prefixCls: 'ant-tree',
checkable: false,
showIcon: false,
openAnimation: animation,
};
Tree.TreeNode = RcTree.TreeNode;