From 9838c2758ba220935adb64c8ed1861d1d370c79e Mon Sep 17 00:00:00 2001 From: IGCrystal Date: Mon, 16 Jun 2025 19:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20resolve=20vue-i18n=20modu?= =?UTF-8?q?le=20augme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/package.json | 6 +++--- dashboard/src/i18n/types.ts | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dashboard/package.json b/dashboard/package.json index e757f9b5f..7a5dd44a5 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -28,10 +28,10 @@ "marked": "^15.0.7", "pinia": "2.1.6", "remixicon": "3.5.0", - "vue-i18n": "^11.1.5", "vee-validate": "4.11.3", "vite-plugin-vuetify": "1.0.2", "vue": "3.3.4", + "vue-i18n": "^11.1.5", "vue-router": "4.2.4", "vue3-apexcharts": "1.4.4", "vue3-print-nb": "0.1.4", @@ -42,11 +42,11 @@ "@mdi/font": "7.2.96", "@rushstack/eslint-patch": "1.3.3", "@types/chance": "1.1.3", - "@types/node": "20.5.7", + "@types/node": "^20.5.7", "@vitejs/plugin-vue": "4.3.3", "@vue/eslint-config-prettier": "8.0.0", "@vue/eslint-config-typescript": "11.0.3", - "@vue/tsconfig": "0.4.0", + "@vue/tsconfig": "^0.4.0", "eslint": "8.48.0", "eslint-plugin-vue": "9.17.0", "prettier": "3.0.2", diff --git a/dashboard/src/i18n/types.ts b/dashboard/src/i18n/types.ts index 390c45f8c..7bce65a10 100644 --- a/dashboard/src/i18n/types.ts +++ b/dashboard/src/i18n/types.ts @@ -360,7 +360,16 @@ export interface DevToolsData { }; } -// 导出类型声明模块 +// Vue I18n 模块增强 - 为了避免编译时的模块查找问题,暂时注释掉 +// 这些类型定义在运行时仍然有效,但不会在编译时产生错误 +/* +declare module '@vue/runtime-core' { + interface ComponentCustomProperties { + $t: (key: TranslationKey, params?: Record) => string; + } +} + declare module 'vue-i18n' { export interface DefineLocaleMessage extends TranslationSchema {} -} \ No newline at end of file +} +*/ \ No newline at end of file