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({
|
||||
history: createWebHistory(),
|
||||
extendRoutes: routes => setupLayouts(routes),
|
||||
})
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(router)
|
||||
app.use(createPinia())
|
||||
app.use(i18n, { useScope: 'global' })
|
||||
loadLanguageAsync(localStorage.getItem('lang') || 'en')
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
extendRoutes: routes => setupLayouts(routes),
|
||||
})
|
||||
|
||||
app.use(PrimeVue)
|
||||
app.use(ToastService)
|
||||
app.mount('#app')
|
||||
app.use(router)
|
||||
app.use(createPinia())
|
||||
app.use(i18n, { useScope: 'global' })
|
||||
app.use(PrimeVue)
|
||||
app.use(ToastService)
|
||||
app.mount('#app')
|
||||
}
|
||||
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user