random-web-tools/src/components/Sidebar.vue
2024-04-11 20:59:20 +03:00

63 lines
1.6 KiB
Vue

<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">
<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>
</template>
<script>
export default {
name: "Sidebar",
components: {},
data() {
return {
menuRoutes: {},
};
},
mounted() {
let menuRoutes = {
'General': {
'home': 'Home',
'explain_crontab': 'Explain crontab',
'table_to_mediawiki_table': 'Table to Mediawiki table',
'dummy_image': 'Dummy image',
'humans_txt': 'humans.txt generator',
},
'Strings': {
'fix_ru_en_keyboard': 'Fix ru-en keyboard',
'str_length': 'Str length',
'str_sort_lines': 'Str sort lines',
'str_to_lower_upper': 'Str to lower/upper',
'str_remove_duplicate_lines': 'Str remove duplicate lines',
'url_encode_decode': 'URL encode/decode',
'url_query_viewer': 'URL query viewer',
},
'PHP': {
'str_to_php_array': 'Str to PHP array',
'php_array_to_json': 'PHP array to Json',
},
'GO': {
'go_json_to_struct': 'JSON to Go struct',
},
'JSON': {
'json_formatter': 'JSON formatter',
},
'SQL': {
'sql_formatter': 'SQL formatter',
'sql_split_in': 'SQL split IN',
},
};
this.menuRoutes = menuRoutes;
}
}
</script>