fix: 修改i18n出现的bug
This commit is contained in:
parent
beabebaadc
commit
3ea51a514b
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue