diff --git a/components/tree/Tree.tsx b/components/tree/Tree.tsx index ad90acbd85..a2ebd1dfc6 100644 --- a/components/tree/Tree.tsx +++ b/components/tree/Tree.tsx @@ -126,7 +126,7 @@ export interface TreeProps extends Omit boolean; loadedKeys?: Key[]; /** 设置节点可拖拽(IE>8) */ - draggable?: boolean; + draggable?: ((node: DataNode) => boolean) | boolean; style?: React.CSSProperties; showIcon?: boolean; icon?: ((nodeProps: AntdTreeNodeAttribute) => React.ReactNode) | React.ReactNode; diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index 596c4dca0c..98a922ea4b 100644 --- a/components/tree/index.en-US.md +++ b/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 | - | | diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index 5033d2fff8..07c088d020 100644 --- a/components/tree/index.zh-CN.md +++ b/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 | - | |