refactor: make the sidebar logo clickable

This commit is contained in:
mrholek
2024-01-02 20:08:19 +01:00
parent da5a963428
commit e5aeb25559
+8 -15
View File
@@ -14,32 +14,24 @@
"
>
<CSidebarHeader class="border-bottom">
<CSidebarBrand>
<CIcon
custom-class-name="sidebar-brand-full"
:icon="logo"
:height="32"
/>
<CIcon
custom-class-name="sidebar-brand-narrow"
:icon="sygnet"
:height="32"
/>
<RouterLink custom to="/" v-slot="{ href, navigate }">
<CSidebarBrand v-bind="$attrs" as="a" :href="href" @click="navigate">
<CIcon custom-class-name="sidebar-brand-full" :icon="logo" :height="32" />
<CIcon custom-class-name="sidebar-brand-narrow" :icon="sygnet" :height="32" />
</CSidebarBrand>
</RouterLink>
<CCloseButton class="d-lg-none" dark @click="$store.commit('toggleSidebar')" />
</CSidebarHeader>
<AppSidebarNav />
<CSidebarFooter class="border-top">
<CSidebarToggler
class="d-none d-lg-flex"
@click="$store.commit('toggleUnfoldable')"
/>
<CSidebarToggler class="d-none d-lg-flex" @click="$store.commit('toggleUnfoldable')" />
</CSidebarFooter>
</CSidebar>
</template>
<script>
import { computed } from 'vue'
import { RouterLink } from 'vue-router'
import { useStore } from 'vuex'
import { AppSidebarNav } from './AppSidebarNav'
import { logo } from '@/assets/brand/logo'
@@ -48,6 +40,7 @@ export default {
name: 'AppSidebar',
components: {
AppSidebarNav,
RouterLink,
},
setup() {
const store = useStore()