From 437d87f19ed2061439aee205fa1ceb25aec4659d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Mon, 28 Mar 2022 18:31:32 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E8=B0=83=E6=95=B4setupApp=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 10 +++++----- src/router/index.js | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) 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() }