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"> <CSidebarHeader class="border-bottom">
<CSidebarBrand> <RouterLink custom to="/" v-slot="{ href, navigate }">
<CIcon <CSidebarBrand v-bind="$attrs" as="a" :href="href" @click="navigate">
custom-class-name="sidebar-brand-full" <CIcon custom-class-name="sidebar-brand-full" :icon="logo" :height="32" />
:icon="logo" <CIcon custom-class-name="sidebar-brand-narrow" :icon="sygnet" :height="32" />
:height="32"
/>
<CIcon
custom-class-name="sidebar-brand-narrow"
:icon="sygnet"
:height="32"
/>
</CSidebarBrand> </CSidebarBrand>
</RouterLink>
<CCloseButton class="d-lg-none" dark @click="$store.commit('toggleSidebar')" /> <CCloseButton class="d-lg-none" dark @click="$store.commit('toggleSidebar')" />
</CSidebarHeader> </CSidebarHeader>
<AppSidebarNav /> <AppSidebarNav />
<CSidebarFooter class="border-top"> <CSidebarFooter class="border-top">
<CSidebarToggler <CSidebarToggler class="d-none d-lg-flex" @click="$store.commit('toggleUnfoldable')" />
class="d-none d-lg-flex"
@click="$store.commit('toggleUnfoldable')"
/>
</CSidebarFooter> </CSidebarFooter>
</CSidebar> </CSidebar>
</template> </template>
<script> <script>
import { computed } from 'vue' import { computed } from 'vue'
import { RouterLink } from 'vue-router'
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { AppSidebarNav } from './AppSidebarNav' import { AppSidebarNav } from './AppSidebarNav'
import { logo } from '@/assets/brand/logo' import { logo } from '@/assets/brand/logo'
@@ -48,6 +40,7 @@ export default {
name: 'AppSidebar', name: 'AppSidebar',
components: { components: {
AppSidebarNav, AppSidebarNav,
RouterLink,
}, },
setup() { setup() {
const store = useStore() const store = useStore()