mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 15:19:58 +08:00
eaae43abdd
This covers Carousel, InputNumber, Select, Slider, Switch, TreeSelect and Tree.
28 lines
619 B
JavaScript
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;
|