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

53 lines
1.3 KiB
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-12-14 10:16:40 +02:00
'explain_crontab': 'Explain crontab',
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',
'str_length': 'Str length',
2023-12-04 10:56:09 +02:00
'str_sort_lines': 'Str sort lines',
'str_to_lower_upper': 'Str to lower/upper',
2023-12-04 10:35:34 +02:00
'str_remove_duplicate_lines': 'Str remove duplicate lines',
2023-12-12 12:27:46 +02:00
'url_encode_decode': 'URL encode/decode',
},
'PHP': {
2023-12-12 11:45:57 +02:00
'str_to_php_array': 'Str to PHP array',
2023-12-12 12:21:09 +02:00
'php_array_to_json': 'PHP array to Json',
2023-11-10 16:46:05 +02:00
},
'SQL': {
2023-12-15 12:11:46 +02:00
'sql_formatter': 'SQL formatter',
2023-11-10 16:46:05 +02:00
'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>