@@ -16,8 +16,8 @@ const CNavGroup = defineComponent({
16
16
required : false ,
17
17
} ,
18
18
} ,
19
- emits : [ 'visibleChange ' ] ,
20
- setup ( props , { emit , slots } ) {
19
+ emits : [ 'visible-change ' ] ,
20
+ setup ( props , { slots , emit } ) {
21
21
const visible = ref ( props . visible )
22
22
const navGroupRef = ref ( )
23
23
@@ -49,7 +49,7 @@ const CNavGroup = defineComponent({
49
49
50
50
const handleTogglerClick = function ( ) {
51
51
visible . value = ! visible . value
52
- emit ( 'visibleChange ' , visible . value )
52
+ emit ( 'visible-change ' , visible . value )
53
53
}
54
54
const handleBeforeEnter = ( el : RendererElement ) => {
55
55
el . style . height = '0px'
@@ -121,12 +121,17 @@ const CNavGroup = defineComponent({
121
121
] ,
122
122
} ,
123
123
slots . default &&
124
- slots . default ( ) . map ( ( vnode , index ) =>
125
- h ( vnode , {
126
- onVisibleChange : ( visible : boolean ) => handleVisibleChange ( visible , index ) ,
127
- visible : isVisible ( index ) ,
128
- } ) ,
129
- ) ,
124
+ slots . default ( ) . map ( ( vnode , index ) => {
125
+ // @ts -expect-error name is defined in component
126
+ if ( vnode . type . name === 'CNavGroup' ) {
127
+ return h ( vnode , {
128
+ onVisibleChange : ( visible : boolean ) =>
129
+ handleVisibleChange ( visible , index ) ,
130
+ visible : isVisible ( index ) ,
131
+ } )
132
+ }
133
+ return vnode
134
+ } ) ,
130
135
) ,
131
136
} ,
132
137
) ,
0 commit comments