Skip to content

Commit 46c9db9

Browse files
committed
fix(CSidebarNav): CNavGroup behavior
1 parent 60d84ee commit 46c9db9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/nav/CNavGroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const CNavGroup = defineComponent({
1212
*/
1313
visible: {
1414
type: Boolean,
15-
default: false,
15+
default: undefined,
1616
required: false,
1717
},
1818
},
@@ -127,7 +127,7 @@ const CNavGroup = defineComponent({
127127
return h(vnode, {
128128
onVisibleChange: (visible: boolean) =>
129129
handleVisibleChange(visible, index),
130-
visible: isVisible(index),
130+
...(visibleGroup.value && { visible: isVisible(index) }),
131131
})
132132
}
133133
return vnode

src/components/sidebar/CSidebarNav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const CSidebarNav = defineComponent({
2929
if (vnode.type.name === 'CNavGroup') {
3030
return h(vnode, {
3131
onVisibleChange: (visible: boolean) => handleVisibleChange(visible, index),
32-
visible: isVisible(index),
32+
...(visibleGroup.value && { visible: isVisible(index) }),
3333
})
3434
}
3535
return vnode

0 commit comments

Comments
 (0)