1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-12-16 23:20:14 +00:00

meilleure initialisation du menu principal + équipement

This commit is contained in:
Maxime Moraine 2020-04-09 09:40:55 +02:00
parent b1b97a01e9
commit c34341f375
10 changed files with 751 additions and 9 deletions

View file

@ -77,7 +77,8 @@ module.exports = {
children: [
{
title: 'Les races',
path: '/races/'
path: '/races/',
exact: true
},
{
title: 'Demi-elfe',
@ -135,10 +136,12 @@ module.exports = {
},
{
title: "Personnalité & Historique",
path: '/personnalite-et-historique/',
children: [
{
title: "Personnalité & Historique",
path: '/personnalite-et-historique/'
path: '/personnalite-et-historique/',
exact: true
},
{
title: "Brigand",
@ -208,10 +211,12 @@ module.exports = {
},
{
title: "Classes",
path: '/classes/',
children: [
{
title: "Les classes",
path: '/classes/'
path: '/classes/',
exact: true
},
{
title: "Barbare",
@ -263,6 +268,43 @@ module.exports = {
}
]
},
{
title: "Équipement",
children: [
{
title: "Système monétaire",
path: '/systeme-monetaire/'
},
{
title: "Armures",
path: '/armures/'
},
{
title: "Armes",
path: '/armes/'
},
{
title: "Équipement d'aventurier",
path: '/equipement-d-aventurier/'
},
{
title: "Outils",
path: '/outils/'
},
{
title: "Montures et véhicules",
path: '/montures-et-vehicules/'
},
{
title: "Marchandises",
path: '/marchandises/'
},
{
title: "Dépenses courantes",
path: '/depenses-courantes/'
}
]
},
{
title: 'Options de personnalisation',
path: '/options-de-personnalisation/'
@ -297,7 +339,7 @@ module.exports = {
title: 'Pour les meneurs',
children: [
{
title: "Les trésorrs",
title: "Les trésors",
path: '/les-tresors/'
},
{

View file

@ -2,7 +2,7 @@
<v-navigation-drawer class="main-drawer" v-model="drawer" :clipped="$vuetify.breakpoint.lgAndUp" width="300" app>
<v-list dense nav>
<template v-for="item in items">
<v-list-group v-if="item.children" :key="item.title" v-model="item.expanded" color="accent">
<v-list-group v-if="item.children" :key="item.title" :value="isExpanded(item)" color="accent">
<template v-slot:activator>
<v-list-item-content>
<v-list-item-title>
@ -12,7 +12,7 @@
</template>
<template v-for="child in item.children">
<v-list-group v-if="child.children" :key="child.title" sub-group v-model="child.expanded" color="accent">
<v-list-group v-if="child.children" :key="child.title" sub-group :value="isExpanded(child)" color="accent">
<template v-slot:activator>
<v-list-item-content>
<v-list-item-title>
@ -20,7 +20,7 @@
</v-list-item-title>
</v-list-item-content>
</template>
<v-list-item v-for="subchild in child.children" link :to="{path: subchild.path}" exact>
<v-list-item v-for="subchild in child.children" link :to="{path: subchild.path}" :exact="subchild.exact">
<v-list-item-content>
<v-list-item-title>
{{ subchild.title }}
@ -28,7 +28,7 @@
</v-list-item-content>
</v-list-item>
</v-list-group>
<v-list-item v-else :key="child.title" link :to="{path: child.path}" exact>
<v-list-item v-else :key="child.title" link :to="{path: child.path}" :exact="child.exact">
<v-list-item-content>
<v-list-item-title>
{{ child.title }}
@ -37,7 +37,7 @@
</v-list-item>
</template>
</v-list-group>
<v-list-item v-else :key="item.title" link :to="{path: item.path}" color="accent" exact>
<v-list-item v-else :key="item.title" link :to="{path: item.path}" color="accent" :exact="item.exact">
<v-list-item-content>
<v-list-item-title>
{{ item.title }}
@ -75,6 +75,27 @@ export default {
},
methods: {
isExpanded (item) {
if (item.children) {
for (var i = 0; i < item.children.length; i++) {
if (item.children[i].path) {
if (item.children[i].path == this.$route.path) {
return true
}
}
if (item.children[i].children) {
for (var j = 0; j < item.children[i].children.length; j++) {
if (item.children[i].path) {
if (item.children[i].children[j].path == this.$route.path) {
return true
}
}
}
}
}
}
return false
}
}
}
</script>