import { createRouter, createWebHistory } from 'vue-router' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/', name: 'index', component: () => import('../views/IndexView.vue'), meta: { title: 'MainFrame' }, children: [ { path: '', name: 'home', component: () => import('../views/Index/HomeView.vue') }, { path: 'about', name: 'about', component: () => import('../views/Index/AboutView.vue') } ] }, { path: '/discord', name: 'discord', component: () => import('../views/DiscordView.vue'), meta: { title: 'MainFrame | Discord', discordAuth: false }, children: [ { path: 'dashboard', name: 'dashboard', component: () => import('../views/Discord/DashboardView.vue'), children: [ { path: '', name: 'dashboardMain', component: () => import('../views/Discord/Dashboard/MainView.vue') }, { path: 'bot/:botId(\\d+)', name: 'dashboardBot', component: () => import('../views/Discord/Dashboard/BotView.vue'), props: true }, { path: 'bot/:botId(\\d+)/guild/:guildId(\\d+)', name: 'dashboardGuild', component: () => import('../views/Discord/Dashboard/GuildView.vue'), props: true } ] }, { path: 'config', name: 'config', component: () => import('../views/Discord/ConfigView.vue') }, { path: 'logout', name: 'logout', component: () => import('../views/Discord/LogoutView.vue'), meta: { discordAuth: false } } ] }, { path: '/:pathMatch(.*)*', name: '404', component: () => import('../views/404View.vue'), meta: { title: 'MainFrame | 404' } } ] }) router.beforeEach((to, from, next) => { document.title = to.meta.title as string next() }) export default router