Skip to content

Commit

Permalink
fix(n-tree): on virtual-scroll empty data placeholder lost problem (#…
Browse files Browse the repository at this point in the history
…5197)

Co-authored-by: 07akioni <07akioni2@gmail.com>
  • Loading branch information
jahnli and 07akioni authored Nov 11, 2023
1 parent 6db3e18 commit dcd50bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Fix `n-tree` unexposed line color variable `--n-line-color`, closes [#5339](https://github.com/tusen-ai/naive-ui/issues/5339).
- Fix `n-tree` The style of the selected node is not displayed in the case of 'disabled'.
- Fix `n-tree` on `virtual-scroll` empty data placeholder lost problem.

### Features

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- 修复 `n-tree` 未暴露连接线颜色变量 `--n-line-color`,关闭[#5339](https://github.com/tusen-ai/naive-ui/issues/5339)
- 修复 `n-tree``disabled` 的情况下不显示选中节点的样式
- 修复 `n-tree` `virtual-scroll` 空数据占位符丢失

### Features

Expand Down
10 changes: 9 additions & 1 deletion src/tree/src/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,15 @@ export default defineComponent({
{{
default: () => {
this.onRender?.()
return (
return !fNodes.length ? (
resolveSlot(this.$slots.empty, () => [
<NEmpty
class={`${mergedClsPrefix}-tree__empty`}
theme={this.mergedTheme.peers.Empty}
themeOverrides={this.mergedTheme.peerOverrides.Empty}
/>
])
) : (
<VVirtualList
ref="virtualListInstRef"
items={this.fNodes}
Expand Down

0 comments on commit dcd50bc

Please sign in to comment.