mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-12 00:00:01 +08:00
feat: 完成主题切换,语言切换的本地存储
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
//语言
|
||||
import { lang } from '@/settings/designSetting'
|
||||
import { createI18n } from 'vue-i18n' //引入vue-i18n组件
|
||||
import { getLocalStorage } from '@/utils/index'
|
||||
import { GO_LANG_SELECT } from '@/settings/storageConst'
|
||||
import zh from './zh/index'
|
||||
import en from './en/index'
|
||||
|
||||
const lang_storage = getLocalStorage(GO_LANG_SELECT)
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: lang_storage || lang,
|
||||
globalInjection: true,
|
||||
messages: {
|
||||
zh: zh,
|
||||
en: en
|
||||
}
|
||||
})
|
||||
|
||||
export default i18n
|
||||
|
||||
Reference in New Issue
Block a user