12
This commit is contained in:
parent
0d1342414b
commit
8cb35f4f1b
@ -1,4 +1,4 @@
|
||||
import type { Locale as TypeLocale } from '#i18n'
|
||||
|
||||
import { Locale } from 'vant'
|
||||
import enUS from 'vant/es/locale/lang/en-US'
|
||||
import zhCN from 'vant/es/locale/lang/zh-CN'
|
||||
@ -6,7 +6,7 @@ import jaJP from 'vant/es/locale/lang/ja-JP'
|
||||
import zhTW from 'vant/es/locale/lang/zh-TW'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
// 载入 vant 语言包
|
||||
|
||||
Locale.use('zh-CN', zhCN)
|
||||
Locale.use('en-US', enUS)
|
||||
Locale.use('ja-JP', jaJP)
|
||||
@ -15,11 +15,9 @@ export default defineNuxtPlugin(() => {
|
||||
if (import.meta.client) {
|
||||
const i18n = useNuxtApp().$i18n
|
||||
const { setLocale } = i18n
|
||||
|
||||
const lang = localStorage.getItem('lang')
|
||||
|
||||
if (lang) {
|
||||
setLocale(lang as TypeLocale)
|
||||
setLocale(lang)
|
||||
Locale.use(lang)
|
||||
}
|
||||
else {
|
Loading…
Reference in New Issue
Block a user