fix: 修改i18n出现的bug

This commit is contained in:
caoqianming 2025-12-18 11:28:24 +08:00
parent beabebaadc
commit 3ea51a514b
3 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@
<script>
import colorTool from "@/utils/color";
import i18n from '@/locales'
export default {
name: "App",
data() {
@ -26,7 +27,8 @@ export default {
},
computed: {
locale() {
return this.$i18n.messages[this.$i18n.locale].el;
const lang = i18n.global.locale.value
return i18n.global.messages.value?.[lang]?.el
},
},
created() {

View File

@ -21,8 +21,9 @@ const messages = {
const i18n = createI18n({
locale: tool.data.get("APP_LANG") || sysConfig.LANG,
fallbackLocale: 'zh-cn',
globalInjection: true,
globalInjection: false,
messages,
legacy: false
})
export default i18n;

View File

@ -33,6 +33,7 @@ app.use(DataVVue3);
//挂载app
app.mount("#app");
app.config.globalProperties.$t = i18n.global.t
const debounce = (fn, delay) => {
let timer = null;