forked from github/dataease
fix: 移动端语言切换
This commit is contained in:
parent
d5164d59a0
commit
a90c128cad
@ -39,14 +39,20 @@ export default {
|
||||
},
|
||||
onLoad(e) {
|
||||
this.language = getLanguage()
|
||||
|
||||
},
|
||||
methods: {
|
||||
radioChange(node) {
|
||||
this.language = node.detail.value
|
||||
if(node.detail.value === 'sys') {
|
||||
var local = uni.getLocale()
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
var local = res.language === 'zh-CN' ? 'zh-Hans' : res.language === 'zh-TW' ? 'zh-Hant' : 'en'
|
||||
uni.setLocale(local)
|
||||
this.$i18n.locale = local
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}else {
|
||||
uni.setLocale(node.detail.value)
|
||||
|
Loading…
Reference in New Issue
Block a user