Browse Source

fix: TS definition for Tree (#28262)

pull/28274/head
David Sichau 4 years ago
committed by GitHub
parent
commit
3562c7aaca
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/tree/Tree.tsx
  2. 2
      components/tree/index.en-US.md
  3. 2
      components/tree/index.zh-CN.md

2
components/tree/Tree.tsx

@ -126,7 +126,7 @@ export interface TreeProps extends Omit<RcTreeProps, 'prefixCls' | 'showLine' |
filterAntTreeNode?: (node: AntTreeNode) => boolean;
loadedKeys?: Key[];
/** 设置节点可拖拽(IE>8) */
draggable?: boolean;
draggable?: ((node: DataNode) => boolean) | boolean;
style?: React.CSSProperties;
showIcon?: boolean;
icon?: ((nodeProps: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode;

2
components/tree/index.en-US.md

@ -29,7 +29,7 @@ Almost anything can be represented in a tree structure. Examples include directo
| defaultExpandParent | If auto expand parent treeNodes when init | boolean | true | |
| defaultSelectedKeys | Specifies the keys of the default selected treeNodes | string\[] | \[] | |
| disabled | Whether disabled the tree | boolean | false | |
| draggable | Specifies whether this Tree is draggable (IE > 8) | boolean | false | |
| draggable | Specifies whether this Tree or the node is draggable (IE > 8) | boolean \| ((node: DataNode) => boolean) | false | |
| expandedKeys | (Controlled) Specifies the keys of the expanded treeNodes | string\[] | \[] | |
| filterTreeNode | Defines a function to filter (highlight) treeNodes. When the function returns `true`, the corresponding treeNode will be highlighted | function(node) | - | |
| height | Config virtual scroll height. Will not support horizontal scroll when enable this | number | - | |

2
components/tree/index.zh-CN.md

@ -30,7 +30,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Xh-oWqg9k/Tree.svg
| defaultExpandParent | 默认展开父节点 | boolean | true | |
| defaultSelectedKeys | 默认选中的树节点 | string\[] | \[] | |
| disabled | 将树禁用 | boolean | false | |
| draggable | 设置节点可拖拽(IE>8) | boolean | false | |
| draggable | 设置节点可拖拽(IE>8) | boolean \| ((node: DataNode) => boolean) | false | |
| expandedKeys | (受控)展开指定的树节点 | string\[] | \[] | |
| filterTreeNode | 按需筛选树节点(高亮),返回 true | function(node) | - | |
| height | 设置虚拟滚动容器高度,设置后内部节点不再支持横向滚动 | number | - | |

Loading…
Cancel
Save