修改elementplus 语言
This commit is contained in:
parent
324c974505
commit
90ad443178
@ -4,11 +4,14 @@ import App from '/admin/App.vue'
|
|||||||
import router, { bootstrapRouter } from '/admin/router'
|
import router, { bootstrapRouter } from '/admin/router'
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
import zh from 'element-plus/es/locale/lang/zh-cn'
|
import zh from 'element-plus/es/locale/lang/zh-cn'
|
||||||
|
import en from 'element-plus/es/locale/lang/en'
|
||||||
|
|
||||||
import { bootstrapStore } from '/admin/stores'
|
import { bootstrapStore } from '/admin/stores'
|
||||||
import Cache from './cache'
|
import Cache from './cache'
|
||||||
import { bootstrapI18n } from '/admin/i18n'
|
import { bootstrapI18n } from '/admin/i18n'
|
||||||
import guard from '/admin/router/guard'
|
import guard from '/admin/router/guard'
|
||||||
import { bootstrapDirectives } from '/admin/directives'
|
import { bootstrapDirectives } from '/admin/directives'
|
||||||
|
import { Language } from 'element-plus/es/locale'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* catchadmin
|
* catchadmin
|
||||||
@ -64,8 +67,13 @@ export default class CatchAdmin {
|
|||||||
*/
|
*/
|
||||||
protected useElementPlus(): CatchAdmin {
|
protected useElementPlus(): CatchAdmin {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
const languages = {
|
||||||
|
zh, en
|
||||||
|
}
|
||||||
|
|
||||||
|
const language = Cache.get('language') || 'zh'
|
||||||
this.app.use(ElementPlus, {
|
this.app.use(ElementPlus, {
|
||||||
locale: Cache.get('language') === 'zh' || zh,
|
locale: languages[language]
|
||||||
})
|
})
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user