feat: affichage sidebar

This commit is contained in:
Kazhnuz 2023-02-04 10:13:33 +01:00
parent 58ca487c69
commit 56c665eccb

View file

@ -1,11 +1,23 @@
<script setup lang="ts">
import { useConfigStore } from "@/stores/config";
import { computed } from "vue";
const store = useConfigStore();
const sidebar = computed(() => {
return store.getSidebar() ?? { title: "", id: 0, links: [] };
});
</script>
<template> <template>
<aside id="sidebar" class="bg-dark fg-light menu"> <aside id="sidebar" class="bg-dark fg-light menu">
<h1 class="title-5 fg-light">Navigation</h1> <h1 class="title-5 fg-light">Navigation</h1>
<ul> <ul v-for="item in sidebar" :key="item.id">
<li> <div class="menu-divider" v-if="item.title">{{ item.title }}</div>
<router-link to="/jdr/core" class="menu-item" <li v-for="(link, index) in item.links" :key="index">
>Règles de base</router-link <router-link :to="`/jdr/core/${link.path}`" class="menu-item" :replace="true">{{
> link.title
}}</router-link>
</li> </li>
</ul> </ul>
</aside> </aside>