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

Commit

Permalink
fix: sidenav group divider line (#191)
Browse files Browse the repository at this point in the history

Co-authored-by: alexzhang1030 <1642114555@qq.com>
  • Loading branch information
songjianet and alexzhang1030 authored Aug 10, 2023
1 parent 1f7c889 commit 34d0d0c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/client/components/SideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import { getSortedTabs } from '~/store'
const groupedTabs = useGroupedTabs()
const renderedGroupedTabs = computed(() => {
return groupedTabs.value.filter(([, { tabs, show }]) => tabs.length && show)
})
</script>

<template>
Expand All @@ -21,15 +25,13 @@ const groupedTabs = useGroupedTabs()
</div>

<div flex="~ auto col gap-0.5 items-center" of-auto class="no-scrollbar" py1>
<template v-for="[name, { tabs, show }], idx of groupedTabs" :key="name">
<template v-if="tabs.length && show">
<div v-if="idx" my1 h-1px w-8 border="b base" />
<SideNavItem
v-for="tab of getSortedTabs(tabs)"
:key="tab.path"
:tab="tab"
/>
</template>
<template v-for="[name, { tabs }], idx of renderedGroupedTabs" :key="name">
<SideNavItem
v-for="tab of getSortedTabs(tabs)"
:key="tab.path"
:tab="tab"
/>
<div v-if="idx !== renderedGroupedTabs.length - 1" my1 h-1px w-8 border="b base" />
</template>
<div flex-auto />
</div>
Expand Down

0 comments on commit 34d0d0c

Please sign in to comment.