33 lines
706 B
Vue
33 lines
706 B
Vue
<script setup lang="ts">
|
|
import { useAuthStore } from '@/auth';
|
|
import { computed } from 'vue';
|
|
import { RouterView, useRoute } from 'vue-router';
|
|
import { Sidebar } from './sidebar';
|
|
|
|
const route = useRoute();
|
|
const authStore = useAuthStore();
|
|
|
|
const hideSidebar = computed(() => {
|
|
return !authStore.isLoggedIn || route.name === 'callback' || route.name === 'about';
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<template v-if="hideSidebar">
|
|
<RouterView />
|
|
</template>
|
|
<template v-else>
|
|
<Sidebar />
|
|
<div class="main-container">
|
|
<RouterView />
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
<style scoped lang="postcss">
|
|
div.main-container {
|
|
@apply px-4 sm:ml-64;
|
|
}
|
|
</style>
|
|
|