ff-admin/src/layouts/Sidebar.vue

37 lines
965 B
Vue
Raw Normal View History

2024-08-23 14:42:32 +02:00
<template>
<div class="w-full h-full flex flex-row gap-4">
<div
class="flex-col gap-4 md:min-w-72 lg:min-w-96"
:class="defaultRoute && defaultSidebar ? 'flex w-full md:w-72 lg:w-96' : 'hidden md:flex'"
>
<slot name="sidebar"></slot>
</div>
2024-09-01 19:19:48 +02:00
<div class="max-w-full grow flex-col gap-2" :class="defaultRoute && defaultSidebar ? 'hidden md:flex' : 'flex'">
2024-08-23 14:42:32 +02:00
<slot name="main"></slot>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
2024-09-17 16:44:02 +02:00
import { useNavigationStore } from "@/stores/admin/navigation";
2024-08-23 14:42:32 +02:00
</script>
<script lang="ts">
export default defineComponent({
props: {
defaultSidebar: {
type: Boolean,
default: true,
},
},
computed: {
...mapState(useNavigationStore, ["activeLink"]),
defaultRoute() {
2024-09-01 19:19:48 +02:00
return ((this.$route?.name as string) ?? "").includes("-default");
2024-08-23 14:42:32 +02:00
},
},
});
</script>