Skip to content

Commit

Permalink
fix(tree): can't expand node with type='group', closes #3388
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Jul 30, 2022
1 parent 2027fef commit b712877
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Fixes

- Fix `n-tree` can't expand node with `type='group'`, closes [#3388](https://github.com/TuSimple/naive-ui/issues/3388).

## 2.32.1

### Fixes
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Fixes

- 修复 `n-tree` 在传入的节点数据中包含 `type='group'` 时无法展开,关闭 [#3388](https://github.com/TuSimple/naive-ui/issues/3388)

## 2.32.1

### Fixes
Expand Down
3 changes: 3 additions & 0 deletions src/tree/src/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export function createTreeMateOptions<T> (
childrenField: string
): TreeMateOptions<T, T, T> {
return {
getIsGroup () {
return false
},
getKey (node: T) {
return (node as any)[keyField]
},
Expand Down

0 comments on commit b712877

Please sign in to comment.