Refactor menu

This commit is contained in:
Illya Marchenko 2023-11-10 16:46:05 +02:00
parent 93953e52d7
commit 91da4c34a5
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F
2 changed files with 21 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 37 KiB

@ -6,26 +6,38 @@
<hr class="mt-2 mb-2"> <hr class="mt-2 mb-2">
<nav class="flex flex-col ml-2"> <nav class="flex flex-col ml-2">
<router-link v-for="[key, value] of Object.entries(menuRoutes)" :to="{name:key}" tag="button">{{ value }}</router-link> <div v-for="[title, routes] of Object.entries(menuRoutes)" class="flex flex-col mb-2">
<p><i>{{ title }}</i></p>
<router-link v-for="[key, value] of Object.entries(routes)" :to="{name:key}" class="ml-4" tag="button">{{ value }}</router-link>
</div>
</nav> </nav>
</template> </template>
<script> <script>
export default { export default {
name: "Sidebar", name: "Sidebar",
components: {}, components: {},
data() { data() {
return { return {
menuRoutes: { menuRoutes: {},
'home': 'Home',
'sql_split_in': 'SQL split IN',
'str_to_upper': 'Str to upper',
'str_to_lower': 'Str to lower',
},
}; };
}, },
mounted() { mounted() {
let menuRoutes = {
'General': {
'home': 'Home',
},
'Strings': {
'str_to_lower': 'Str to lower',
'str_to_upper': 'Str to upper',
},
'SQL': {
'sql_split_in': 'SQL split IN',
},
};
this.menuRoutes = menuRoutes;
} }
} }
</script> </script>