Skip to content

Commit

Permalink
docs(web): add Tree FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
RSS1102 committed Dec 9, 2024
1 parent 324c0c0 commit 2ecf03f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/web/api/tree.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,11 @@ Connects parent nodes in the tree with their child nodes at the same level. This
### Why doesn't the `onChange` callback return the value of the parent node when child node is selected in `valueMode = 'all'` mode?

In `valueMode = 'all'` mode, the parent node will only appear in the selected values if all its child nodes are selected.

### Why do other nodes get selected when I select a node?

The `value` field of each item in the `data` array provided to the `Tree` component must be unique to avoid multiple selection issues caused by duplicate indices.

### Why can't I expand nodes correctly even though I set `expanded`?

The `value` field of each item in the `data` array provided to the `Tree` component must be unique to avoid incorrect expansion caused by duplicate indices.
8 changes: 8 additions & 0 deletions docs/web/api/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,11 @@ spline: data
### 为什么在 `valueMode = 'all'` 模式下,选中子节点时 `onChange` 回调并没有返回父节点的值?

`valueMode = 'all'` 模式下,必须当前子节点被全部选中后,父节点才会出现在选中值里面。

### 为什么我选中了一个选中了一个节点,但是其他节点也有被选中的情况?

提供给 `Tree` 组件的数组 `data` 数据中的每个 `value` 字段的值必须是唯一的,避免重复索引导致多选问题。

### 为什么我设置了 `expanded` 却不能正确展开节点?

提供给 `Tree` 组件的数组 `data` 数据中的每个 `value` 字段的值必须是唯一的,避免重复索引导致不能正确展开。

0 comments on commit 2ecf03f

Please sign in to comment.