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 { 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()

View File

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