mirror of
https://github.com/EasyTier/EasyTier.git
synced 2024-11-16 03:32:43 +08:00
🐞 fix: 全局作用域中异步加载语言
This commit is contained in:
parent
5605d239ce
commit
c768e1d13b
|
@ -26,18 +26,22 @@ if (import.meta.env.PROD) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const app = createApp(App)
|
async function main() {
|
||||||
|
await loadLanguageAsync(localStorage.getItem('lang') || 'en')
|
||||||
|
|
||||||
const router = createRouter({
|
const app = createApp(App)
|
||||||
|
|
||||||
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
extendRoutes: routes => setupLayouts(routes),
|
extendRoutes: routes => setupLayouts(routes),
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.use(createPinia())
|
app.use(createPinia())
|
||||||
app.use(i18n, { useScope: 'global' })
|
app.use(i18n, { useScope: 'global' })
|
||||||
loadLanguageAsync(localStorage.getItem('lang') || 'en')
|
app.use(PrimeVue)
|
||||||
|
app.use(ToastService)
|
||||||
|
app.mount('#app')
|
||||||
|
}
|
||||||
|
|
||||||
app.use(PrimeVue)
|
main()
|
||||||
app.use(ToastService)
|
|
||||||
app.mount('#app')
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user