let sub_routes = []; const modules = import.meta.glob("./routes/*.route.js", { eager: true }); // eslint-disable-next-line no-unused-vars Object.entries(modules).forEach(([path, definition]) => { sub_routes = sub_routes.concat(definition.default); }); const routes = [ { path: "/", component: () => import("layouts/MainLayout.vue"), meta: { requireAuth: true }, children: [ { path: "", name: "DashboardPage", component: () => import("src/pages/dashboard/DashboardPage.vue"), meta: { title: "ui.navigation.dashboard", requireAuth: true, requiredPermission: "dashboard", breadcrumbs: [ { name: "DashboardPage", title: "ui.navigation.dashboard", }, ], }, }, { path: "pagamentos", name: "PagamentosPage", component: () => import("src/pages/search/PagamentosPage.vue"), meta: { title: "Busca", requireAuth: true, breadcrumbs: [ { name: "DashboardPage", title: "ui.navigation.dashboard", }, { name: "PagamentosPage", title: "Busca", }, ], }, }, { path: "agenda", name: "AgendaPage", component: () => import("src/pages/agenda/AgendaPage.vue"), meta: { title: "Agenda", requireAuth: true, breadcrumbs: [ { name: "DashboardPage", title: "ui.navigation.dashboard", }, { name: "AgendaPage", title: "Agenda", }, ], }, }, { path: "perfil", name: "ProfilePage", component: () => import("src/pages/profile/ProfilePage.vue"), meta: { title: "Perfil", requireAuth: true, breadcrumbs: [ { name: "DashboardPage", title: "ui.navigation.dashboard", }, { name: "ProfilePage", title: "Perfil", }, ], }, }, ...sub_routes, ], }, { path: "/login", component: () => import("layouts/LoginLayout.vue"), children: [ { path: "", name: "LoginPage", component: () => import("pages/LoginPage.vue"), meta: { title: "Login", }, }, ], }, // Always leave this as last one, // but you can also remove it { path: "/:catchAll(.*)*", component: () => import("pages/ErrorNotFound.vue"), }, ]; export default routes;