Skip to content

Commit e5aeb25

Browse files
committed
refactor: make the sidebar logo clickable
1 parent da5a963 commit e5aeb25

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

src/components/AppSidebar.vue

+9-16
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,24 @@
1414
"
1515
>
1616
<CSidebarHeader class="border-bottom">
17-
<CSidebarBrand>
18-
<CIcon
19-
custom-class-name="sidebar-brand-full"
20-
:icon="logo"
21-
:height="32"
22-
/>
23-
<CIcon
24-
custom-class-name="sidebar-brand-narrow"
25-
:icon="sygnet"
26-
:height="32"
27-
/>
28-
</CSidebarBrand>
17+
<RouterLink custom to="/" v-slot="{ href, navigate }">
18+
<CSidebarBrand v-bind="$attrs" as="a" :href="href" @click="navigate">
19+
<CIcon custom-class-name="sidebar-brand-full" :icon="logo" :height="32" />
20+
<CIcon custom-class-name="sidebar-brand-narrow" :icon="sygnet" :height="32" />
21+
</CSidebarBrand>
22+
</RouterLink>
2923
<CCloseButton class="d-lg-none" dark @click="$store.commit('toggleSidebar')" />
3024
</CSidebarHeader>
3125
<AppSidebarNav />
3226
<CSidebarFooter class="border-top">
33-
<CSidebarToggler
34-
class="d-none d-lg-flex"
35-
@click="$store.commit('toggleUnfoldable')"
36-
/>
27+
<CSidebarToggler class="d-none d-lg-flex" @click="$store.commit('toggleUnfoldable')" />
3728
</CSidebarFooter>
3829
</CSidebar>
3930
</template>
4031

4132
<script>
4233
import { computed } from 'vue'
34+
import { RouterLink } from 'vue-router'
4335
import { useStore } from 'vuex'
4436
import { AppSidebarNav } from './AppSidebarNav'
4537
import { logo } from '@/assets/brand/logo'
@@ -48,6 +40,7 @@ export default {
4840
name: 'AppSidebar',
4941
components: {
5042
AppSidebarNav,
43+
RouterLink,
5144
},
5245
setup() {
5346
const store = useStore()

0 commit comments

Comments
 (0)