mod: 调整setupApp相关写法
This commit is contained in:
parent
dfcc8c2158
commit
437d87f19e
10
src/main.js
10
src/main.js
@ -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()
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user