File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,7 @@ const topNavGroups = computed((): Map<string, SidebarPrimaryItem[]> => {
298
298
return groups
299
299
})
300
300
301
+ const isMobile = useMediaQuery (` max-width: ${KUI_BREAKPOINT_MOBILE } ` )
301
302
const getGroupConfig = (groupName : string = ' ' ): GroupConfig | null => {
302
303
if (groupName === UNGROUPED_NAME || ! groupName .trim ()) {
303
304
return null
@@ -487,9 +488,9 @@ onMounted(async () => {
487
488
window .addEventListener (' resize' , disableTransitions )
488
489
489
490
if (props .groupConfig ) {
490
- for ( const groupName in props . groupConfig ) {
491
- // auto-expand all groups if the user is on mobile
492
- if ( useMediaQuery ( ` (max-width: ${ KUI_BREAKPOINT_MOBILE }) ` ) ) {
491
+ // auto-expand all groups if the user is on mobile
492
+ if ( isMobile . value ) {
493
+ for ( const groupName in props . groupConfig ) {
493
494
const group = props .groupConfig [groupName ]
494
495
group .collapsed = false
495
496
}
@@ -506,6 +507,10 @@ onBeforeUnmount(() => {
506
507
window .removeEventListener (' resize' , debouncedResizeHandler )
507
508
window .removeEventListener (' resize' , disableTransitions )
508
509
})
510
+
511
+ watch (() => props .groupConfig , (newConfig ) => {
512
+ console .log (' groupConfig updated' , newConfig )
513
+ })
509
514
</script >
510
515
511
516
<style lang="scss" scoped>
You can’t perform that action at this time.
0 commit comments