From 4ea7376dbc32374c03e60c131b5ce728762cff6b Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期四, 11 一月 2024 15:26:37 +0800 Subject: [PATCH] fix 修复i18n无感刷新问题 --- src/lang/index.ts | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/lang/index.ts b/src/lang/index.ts index 071599e..e4e1d25 100644 --- a/src/lang/index.ts +++ b/src/lang/index.ts @@ -1,19 +1,8 @@ // 鑷畾涔夊浗闄呭寲閰嶇疆 import { createI18n } from 'vue-i18n'; -// 鏈湴璇█鍖� -import enUSLocale from './en_US'; -import zhCNLocale from './zh_CN'; import { LanguageEnum } from '@/enums/LanguageEnum'; - -const messages = { - zh_CN: { - ...zhCNLocale - }, - en_US: { - ...enUSLocale - } -}; +import messages from '@intlify/unplugin-vue-i18n/messages'; /** * 鑾峰彇褰撳墠璇█ @@ -28,6 +17,8 @@ }; const i18n = createI18n({ + globalInjection: true, + allowComposition: true, legacy: false, locale: getLanguage(), messages -- Gitblit v1.9.3