diff --git a/.vscode/settings.json b/.vscode/settings.json index 3dcb9b1d6..c8da3d854 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,8 @@ ], "[javascript]": { "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" } } diff --git a/jsconfig.json b/jsconfig.json index 8c158e0e0..ee1a17d04 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -13,5 +13,8 @@ "vue$": ["node_modules/vue/dist/vue.runtime.esm-bundler.js"] } }, - "exclude": ["dist", ".quasar", "node_modules"] + "exclude": ["dist", ".quasar", "node_modules"], + "vueCompilerOptions": { + "experimentalDisableTemplateSupport": true + } } diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 6b522ec9b..fccaef1cb 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -7,21 +7,37 @@ import routes from 'src/router/routes'; const { t } = useI18n(); const { hasAny } = useRole(); -const mainRoute = routes.find(route => route.path === '/'); -const moduleRoutes = mainRoute && mainRoute.children || [] +const mainRoute = routes.find((route) => route.path === '/'); +const moduleRoutes = (mainRoute && mainRoute.children) || []; const modules = ref([]); for (const route of moduleRoutes) { const module = { - path: route.path, + stateName: route.name, name: route.name.toLowerCase(), - roles: [] + roles: [], }; if (route.meta) { Object.assign(module, route.meta); } + if (route.children && route.children.length) { + const [moduleMain] = route.children; + const routes = moduleMain.children; + + module.children = routes.map((route) => { + const submodule = { + stateName: route.name, + name: route.name, + }; + + Object.assign(submodule, route.meta); + + return submodule; + }); + } + modules.value.push(module); } @@ -29,18 +45,47 @@ for (const route of moduleRoutes) { \ No newline at end of file + diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index d25fe43a2..e26f120d9 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -1,28 +1,36 @@ - -