mirror of
https://github.com/EasyTier/EasyTier.git
synced 2024-11-16 03:32:43 +08:00
🐞 fix: 全局作用域中异步加载语言
This commit is contained in:
parent
6089813da5
commit
5b14fc05d2
|
@ -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)
|
||||||
history: createWebHistory(),
|
|
||||||
extendRoutes: routes => setupLayouts(routes),
|
|
||||||
})
|
|
||||||
|
|
||||||
app.use(router)
|
const router = createRouter({
|
||||||
app.use(createPinia())
|
history: createWebHistory(),
|
||||||
app.use(i18n, { useScope: 'global' })
|
extendRoutes: routes => setupLayouts(routes),
|
||||||
loadLanguageAsync(localStorage.getItem('lang') || 'en')
|
})
|
||||||
|
|
||||||
app.use(PrimeVue)
|
app.use(router)
|
||||||
app.use(ToastService)
|
app.use(createPinia())
|
||||||
app.mount('#app')
|
app.use(i18n, { useScope: 'global' })
|
||||||
|
app.use(PrimeVue)
|
||||||
|
app.use(ToastService)
|
||||||
|
app.mount('#app')
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user