random-web-tools/src/components/Sidebar.vue

44 lines
942 B
Vue
Raw Normal View History

2023-11-10 16:00:27 +02:00
<template>
<header class="flex">
<span class="my-auto ml-2 font-bold">Tools</span>
</header>
<hr class="mt-2 mb-2">
<nav class="flex flex-col ml-2">
2023-11-10 16:46:05 +02:00
<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>
2023-11-10 16:00:27 +02:00
</nav>
</template>
<script>
2023-11-10 16:46:05 +02:00
2023-11-10 16:00:27 +02:00
export default {
2023-11-10 16:46:05 +02:00
name: "Sidebar",
components: {},
2023-11-10 16:00:27 +02:00
data() {
return {
2023-11-10 16:46:05 +02:00
menuRoutes: {},
};
},
mounted() {
let menuRoutes = {
'General': {
2023-11-10 16:00:27 +02:00
'home': 'Home',
2023-11-10 16:46:05 +02:00
},
'Strings': {
2023-11-28 12:51:58 +02:00
'fix_ru_en_keyboard': 'Fix ru-en keyboard',
2023-11-10 16:00:27 +02:00
'str_to_lower': 'Str to lower',
2023-11-10 16:46:05 +02:00
'str_to_upper': 'Str to upper',
},
'SQL': {
'sql_split_in': 'SQL split IN',
2023-11-10 16:00:27 +02:00
},
};
2023-11-10 16:46:05 +02:00
this.menuRoutes = menuRoutes;
2023-11-10 16:00:27 +02:00
}
}
</script>