mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-01 05:30:04 +08:00
feat: UI i18n depends on router (#289)
This commit is contained in:
@@ -17,6 +17,16 @@ const i18n = createI18n({
|
||||
messages: {}
|
||||
}
|
||||
})
|
||||
|
||||
router.beforeEach((to, from) => {
|
||||
if (to.params.lang) {
|
||||
i18n.global.locale.value = to.params.lang
|
||||
} else {
|
||||
i18n.global.locale.value = 'zh'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const head = createHead()
|
||||
const app = createApp(App)
|
||||
app.use(i18n)
|
||||
|
||||
Reference in New Issue
Block a user