Browse Source

【更新】修改多语种小瑕疵

pull/166/head
小诺 1 year ago committed by 俞宝山
parent
commit
c09fd7ba00
  1. 2
      snowy-admin-web/src/App.vue
  2. 5
      snowy-admin-web/src/layout/components/userbar.vue
  3. 1
      snowy-admin-web/src/locales/index.js

2
snowy-admin-web/src/App.vue

@ -10,5 +10,5 @@
const store = globalStore()
store.initTheme()
const locale = i18n.global.messages[i18n.global.locale].lang
const locale = i18n.global.messages.value[i18n.global.locale.value].lang
</script>

5
snowy-admin-web/src/layout/components/userbar.vue

@ -57,7 +57,6 @@
import { createVNode } from 'vue'
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
import { Modal } from 'ant-design-vue'
import i18n from '@/locales/index'
import screenFull from 'screenfull'
import { message } from 'ant-design-vue'
import Setting from './setting.vue'
@ -68,6 +67,8 @@
import DevUserMessage from './message.vue'
import PanelSearch from './panel-search/index.vue'
import { globalStore } from '@/store'
import { useI18n } from 'vue-i18n'
const { locale } = useI18n()
const lang = ref(new Array(tool.data.get('APP_LANG') || config.LANG))
const settingDialog = ref(false)
@ -142,7 +143,7 @@
const handleIn18 = (key) => {
lang.value = []
lang.value.push(key)
i18n.locale = key
locale.value = key
tool.data.set('APP_LANG', key)
}
//

1
snowy-admin-web/src/locales/index.js

@ -28,6 +28,7 @@ export const messages = {
}
const i18n = createI18n({
legacy: false,
locale: tool.data.get('APP_LANG') || sysConfig.LANG,
fallbackLocale: 'zh-cn',
globalInjection: true,

Loading…
Cancel
Save