修改中英文切换

This commit is contained in:
qq787203167
2022-03-02 17:28:47 +08:00
parent 6bfe21d17f
commit 3788bf3301
+17 -3
View File
@@ -41,9 +41,19 @@
that.$store.dispatch('setSidebar', true)
}
})
let langCn = localStorage.language
// 默认中文
localStorage.lang == undefined ? localStorage.setItem('language', 'zh-cn') : ''
if (!langCn) {
localStorage.setItem('language', 'zh-cn')
} else if (langCn == 'en-us') {
this.locale = enUS
moment.locale('en-us')
this.$i18n.locale = EN
} else if (langCn == 'zh-cn') {
this.locale = zhCN
moment.locale('zh-cn')
this.$i18n.locale = ZH
}
// 自己配置多语言适配
this.$root.Bus.$on('switchLanguage', value => {
let router_path = this.$route.path
@@ -94,7 +104,11 @@
#app {
height: 100%;
}
.doc-detail{background: #fff}
.doc-detail {
background: #fff
}
.ant-layout {
background: transparent !important;
}