mirror of
https://github.com/DavidHDev/vue-bits.git
synced 2026-04-21 17:44:39 -06:00
27 lines
655 B
Vue
27 lines
655 B
Vue
<template>
|
|
<div>
|
|
<DisplayHeader v-if="!isSidebarPage" :activeItem="activeItem" />
|
|
|
|
<router-view />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import DisplayHeader from '@/components/landing/DisplayHeader/DisplayHeader.vue';
|
|
import { computed } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
|
|
const route = useRoute();
|
|
|
|
const sidebarPages = ['/favorites'];
|
|
const isSidebarPage = computed(() => {
|
|
const path = route.path;
|
|
return sidebarPages.some(sidebarPath => path.includes(sidebarPath)) || /^\/[^/]+\/[^/]+$/.test(path);
|
|
});
|
|
|
|
const activeItem = computed(() => {
|
|
if (route.path === '/') return 'home';
|
|
return null;
|
|
});
|
|
</script>
|