Skip to content

Commit a18a9c5

Browse files
authored
fix(TreeSelect): should not render empty nav (youzan#4663)
1 parent d4157e6 commit a18a9c5

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/tree-select/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,17 @@ function TreeSelect(
5656
: activeId === id;
5757
}
5858

59-
const Navs = items.map(item => (
60-
<SidebarItem
61-
dot={item.dot}
62-
info={item.info}
63-
title={item.text}
64-
disabled={item.disabled}
65-
class={bem('nav-item')}
66-
/>
67-
));
59+
const Navs = items
60+
.filter(item => item.text)
61+
.map(item => (
62+
<SidebarItem
63+
dot={item.dot}
64+
info={item.info}
65+
title={item.text}
66+
disabled={item.disabled}
67+
class={bem('nav-item')}
68+
/>
69+
));
6870

6971
function Content() {
7072
if (slots.content) {

0 commit comments

Comments
 (0)