Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 34d0d0c

Browse files
fix: sidenav group divider line (#191)
Co-authored-by: alexzhang1030 <[email protected]>
1 parent 1f7c889 commit 34d0d0c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Diff for: packages/client/components/SideNav.vue

+11-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
import { getSortedTabs } from '~/store'
33
44
const groupedTabs = useGroupedTabs()
5+
6+
const renderedGroupedTabs = computed(() => {
7+
return groupedTabs.value.filter(([, { tabs, show }]) => tabs.length && show)
8+
})
59
</script>
610

711
<template>
@@ -21,15 +25,13 @@ const groupedTabs = useGroupedTabs()
2125
</div>
2226

2327
<div flex="~ auto col gap-0.5 items-center" of-auto class="no-scrollbar" py1>
24-
<template v-for="[name, { tabs, show }], idx of groupedTabs" :key="name">
25-
<template v-if="tabs.length && show">
26-
<div v-if="idx" my1 h-1px w-8 border="b base" />
27-
<SideNavItem
28-
v-for="tab of getSortedTabs(tabs)"
29-
:key="tab.path"
30-
:tab="tab"
31-
/>
32-
</template>
28+
<template v-for="[name, { tabs }], idx of renderedGroupedTabs" :key="name">
29+
<SideNavItem
30+
v-for="tab of getSortedTabs(tabs)"
31+
:key="tab.path"
32+
:tab="tab"
33+
/>
34+
<div v-if="idx !== renderedGroupedTabs.length - 1" my1 h-1px w-8 border="b base" />
3335
</template>
3436
<div flex-auto />
3537
</div>

0 commit comments

Comments
 (0)