55 lines
1.6 KiB
Vue
55 lines
1.6 KiB
Vue
|
<template>
|
||
|
<SidebarLayout>
|
||
|
<template #sidebar>
|
||
|
<SidebarTemplate
|
||
|
:mainTitle="activeNavigationObject.mainTitle"
|
||
|
:topTitle="activeNavigationObject.topTitle"
|
||
|
:showTopList="activeNavigationObject.top != null"
|
||
|
>
|
||
|
<template #topList>
|
||
|
<RoutingLink v-for="item in activeNavigationObject.top" :key="item.key" :link="item" />
|
||
|
</template>
|
||
|
<template #list>
|
||
|
<RoutingLink v-for="item in activeNavigationObject.main" :key="item.key" :link="item" />
|
||
|
</template>
|
||
|
</SidebarTemplate>
|
||
|
</template>
|
||
|
<template #main>
|
||
|
<component v-if="activeLink?.component" :is="activeLink.component" />
|
||
|
<div v-else class="w-full h-full bg-white rounded-lg"></div>
|
||
|
</template>
|
||
|
</SidebarLayout>
|
||
|
</template>
|
||
|
|
||
|
<script setup lang="ts">
|
||
|
import { defineComponent } from "vue";
|
||
|
import { mapState, mapActions } from "pinia";
|
||
|
import { useNavigationStore } from "@/stores/admin/navigation";
|
||
|
import SidebarLayout from "@/layouts/Sidebar.vue";
|
||
|
import SidebarTemplate from "@/templates/Sidebar.vue";
|
||
|
import RoutingLink from "@/components/admin/RoutingLink.vue";
|
||
|
</script>
|
||
|
|
||
|
<script lang="ts">
|
||
|
export default defineComponent({
|
||
|
props: {
|
||
|
contestId: {
|
||
|
type: String,
|
||
|
default: "",
|
||
|
},
|
||
|
},
|
||
|
computed: {
|
||
|
...mapState(useNavigationStore, ["activeNavigationObject", "activeTopLevelObject", "activeLink"]),
|
||
|
},
|
||
|
created() {
|
||
|
this.setLink(this.activeTopLevelObject.levelDefault);
|
||
|
},
|
||
|
beforeUnmount() {
|
||
|
this.resetNavigation();
|
||
|
},
|
||
|
methods: {
|
||
|
...mapActions(useNavigationStore, ["setLink", "resetNavigation", "setTopLevel"]),
|
||
|
},
|
||
|
});
|
||
|
</script>
|