Commit 3a7e11b7 by jianan

fix(build): 顶层 await 包进 bootstrap,兼容 es2020 构建目标

parent 66c94542
...@@ -11,7 +11,11 @@ app.use(createPinia()) ...@@ -11,7 +11,11 @@ app.use(createPinia())
app.use(router) app.use(router)
app.use(i18n) app.use(i18n)
// 挂载前从内存登录态同步用户信息,供 LoginBadge 等组件渲染 // 挂载前从内存登录态同步用户信息,供 LoginBadge 等组件渲染。
await useAuthStore().init() // 包进普通 async 函数,避免使用需要 es2022 的顶层 await。
async function bootstrap(): Promise<void> {
await useAuthStore().init()
app.mount('#app')
}
app.mount('#app') void bootstrap()
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment