index.jsx 661 字节
Newer Older
I
ioldfish 已提交
1
import React from 'react';
I
ioldfish 已提交
2
import Tree from 'rc-tree';
Y
yiminghe 已提交
3
import animation from '../common/openAnimation';
4 5

const AntTree = React.createClass({
I
ioldfish 已提交
6 7
  getDefaultProps() {
    return {
然则 已提交
8 9 10
      prefixCls: 'ant-tree',
      checkable: false,
      showIcon: false,
然则 已提交
11
      openAnimation: animation,
I
ioldfish 已提交
12 13
    };
  },
I
ioldfish 已提交
14
  render() {
然则 已提交
15 16 17 18 19
    const props = this.props;
    let checkable = props.checkable;
    if (checkable) {
      checkable = <span className={`${props.prefixCls}-checkbox-inner`}></span>;
    }
20 21 22 23 24
    return (
      <Tree {...props} checkable={checkable}>
        {this.props.children}
      </Tree>
    );
I
ioldfish 已提交
25 26
  }
});
27 28 29

AntTree.TreeNode = Tree.TreeNode;
export default AntTree;