diff --git a/src/main.js b/src/main.js index 4e5ef24..c3ca48e 100644 --- a/src/main.js +++ b/src/main.js @@ -2,18 +2,18 @@ import '@/styles/index.scss' import 'uno.css' import { createApp } from 'vue' -import App from './App.vue' - import { setupRouter } from '@/router' import { setupStore } from '@/store' +import App from './App.vue' -async function bootstrap() { +async function setupApp() { const app = createApp(App) setupStore(app) - setupRouter(app) + + await setupRouter(app) app.mount('#app', true) } -bootstrap() +setupApp() diff --git a/src/router/index.js b/src/router/index.js index f9c53c9..e24aa3c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -18,7 +18,8 @@ export function resetRouter() { }) } -export function setupRouter(app) { +export async function setupRouter(app) { app.use(router) setupRouterGuard(router) + await router.isReady() }