From ea3629deed158e240ce77e82aa3f19c5a18dd3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Fri, 18 Sep 2020 08:57:47 +0000 Subject: [PATCH] docs: Update Tree height desc close #26769 --- components/tree/index.en-US.md | 5 +++++ components/tree/index.zh-CN.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index 4c69a2d3a5..5d3f11199d 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -31,6 +31,7 @@ Almost anything can be represented in a tree structure. Examples include directo | draggable | Specifies whether this Tree is draggable (IE > 8) | 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 | - | | | loadData | Load data asynchronously | function(node) | - | | | loadedKeys | (Controlled) Set loaded tree nodes. Need work with `loadData` | string\[] | \[] | | | multiple | Allows selecting multiple treeNodes | boolean | false | | @@ -107,3 +108,7 @@ File icon realize by using switcherIcon. You can overwrite the style to hide it: ### Why defaultExpandedAll not working on ajax data? `default` prefix prop only works when inited. So `defaultExpandedAll` has already executed when ajax load data. You can control `expandedKeys` or render Tree when data loaded to realize expanded all. + +### Virtual scroll limitation + +Virtual scroll only render items in visible region. Thus not support auto width (like long `title` with horizontal scroll). diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index e0a4009c16..e7ce4e58f4 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -32,6 +32,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Xh-oWqg9k/Tree.svg | draggable | 设置节点可拖拽(IE>8) | boolean | false | | | expandedKeys | (受控)展开指定的树节点 | string\[] | \[] | | | filterTreeNode | 按需筛选树节点(高亮),返回 true | function(node) | - | | +| height | 设置虚拟滚动容器高度,设置后内部节点不再支持横向滚动 | number | - | | | loadData | 异步加载数据 | function(node) | - | | | loadedKeys | (受控)已经加载的节点,需要配合 `loadData` 使用 | string\[] | \[] | | | multiple | 支持点选多个节点(节点本身) | boolean | false | | @@ -108,3 +109,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Xh-oWqg9k/Tree.svg ### defaultExpandedAll 在异步加载数据时为何不生效? `default` 前缀属性只有在初始化时生效,因而异步加载数据时 `defaultExpandedAll` 已经执行完成。你可以通过受控 `expandedKeys` 或者在数据加载完成后渲染 Tree 来实现全部展开。 + +### 虚拟滚动的限制 + +虚拟滚动通过在仅渲染可视区域的元素来提升渲染性能。但是同时由于不会渲染所有节点,所以无法自动拓转横向宽度(比如超长 `title` 的横向滚动条)。