|
2 | 2 |
|
3 | 3 | `npm install --save react-widget-tree`
|
4 | 4 |
|
| 5 | +## API |
| 6 | + |
| 7 | +```html |
| 8 | +<Tree |
| 9 | +loadData={loadData} |
| 10 | +> |
| 11 | +</Tree> |
| 12 | +``` |
| 13 | + |
| 14 | +### Tree props |
| 15 | + |
| 16 | +| 参数 | 说明 | 类型 | 默认值 | |
| 17 | +| --- | --- | --- | --- | |
| 18 | +| prefixCls | 组件CSS样式前缀 | string | rw-listbox | |
| 19 | +| className | 组件className属性 | string | - | |
| 20 | +| style | 组件style属性 | React.CSSProperties | - | |
| 21 | +| rootId | 根节点ID | any | null | |
| 22 | +| loadingLabel | 数据加载中提示文本 | ReactNode | - | |
| 23 | +| loadingComponent | 数据加载组建类 | ReactElement | div | |
| 24 | +| loadData | 数据装载方法, 该方法接收当前节点数据对象 | function(node:Node) => Promise\|Array<Node> | - | |
| 25 | +| showIcon | 是否显示图标 | boolean | true | |
| 26 | +| showExpanderIcon | 是否显示展开/收起图标 | boolean | true | |
| 27 | +| checkable | 是否显示复选图标 | boolean | true | |
| 28 | +| maxDepth | 树形最大深度 | number | 50 | |
| 29 | +| rootComponent | 树形组建根节点类 | ReactElement | div | |
| 30 | +| childNodesWrapperComponent | 子节点列表容器组件类 | ReactElement | ChildNodesWrapper | |
| 31 | +| nodeItemWrapperComponent | 节点容器组件类 | ReactElement | Fragment | |
| 32 | +| renderIndentIcons | 自定义渲染函数 | function | null | |
| 33 | +| renderExpanderIcon | 自定义渲染函数 | function | null | |
| 34 | +| renderLoadingIcon | 自定义渲染函数 | function | null | |
| 35 | +| renderIcon | 自定义渲染函数 | function | null | |
| 36 | +| renderCheckbox | 自定义渲染函数 | function | null | |
| 37 | +| renderLabel | 自定义渲染函数 | function | null | |
| 38 | +| renderExtIcons | 自定义渲染函数 | function | null | |
| 39 | +| renderNode | 自定义渲染函数 | function | null | |
| 40 | +| onNodeClick | | function | null | |
| 41 | +| onNodeDoubleClick | | function | null | |
| 42 | +| onNodeContextMenu | | function | null | |
| 43 | +| onNodeMouseDown | | function | null | |
| 44 | +| onNodeMouseUp | | function | null | |
| 45 | +| onNodeMouseEnter | | function | null | |
| 46 | +| onNodeMouseLeave | | function | null | |
| 47 | +| onNodeMouseOver | | function | null | |
| 48 | +| onNodeMouseOut | | function | null | |
| 49 | +| onNodeMouseMove | | function | null | |
5 | 50 |
|
6 | 51 | ## Tree属性
|
7 | 52 |
|
|
0 commit comments