mod: 调整setupApp相关写法

This commit is contained in:
张传龙 2022-03-28 18:31:32 +08:00
parent dfcc8c2158
commit 437d87f19e
2 changed files with 7 additions and 6 deletions

View File

@ -2,18 +2,18 @@ import '@/styles/index.scss'
import 'uno.css' import 'uno.css'
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue'
import { setupRouter } from '@/router' import { setupRouter } from '@/router'
import { setupStore } from '@/store' import { setupStore } from '@/store'
import App from './App.vue'
async function bootstrap() { async function setupApp() {
const app = createApp(App) const app = createApp(App)
setupStore(app) setupStore(app)
setupRouter(app)
await setupRouter(app)
app.mount('#app', true) app.mount('#app', true)
} }
bootstrap() setupApp()

View File

@ -18,7 +18,8 @@ export function resetRouter() {
}) })
} }
export function setupRouter(app) { export async function setupRouter(app) {
app.use(router) app.use(router)
setupRouterGuard(router) setupRouterGuard(router)
await router.isReady()
} }