diff --git a/package.json b/package.json index 3dd4fb857774c15605ff6042c26fd3ddb9d14dbf..4af58e6b4aada45d1bb651addd066ed19cc68c8d 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "stylelint-order": "^4.1.0", "ts-node": "^9.1.1", "typescript": "4.1.5", - "vite": "2.0.4", + "vite": "^2.0.4", "vite-plugin-compression": "^0.2.2", "vite-plugin-html": "^2.0.2", "vite-plugin-imagemin": "^0.2.8", diff --git a/src/hooks/web/useI18n.ts b/src/hooks/web/useI18n.ts index a960c562b8140d25228d2fc0265d548acdbc918d..40e11920099601e9ec3af4641ca42162aa4c6bfc 100644 --- a/src/hooks/web/useI18n.ts +++ b/src/hooks/web/useI18n.ts @@ -40,7 +40,7 @@ export function useI18n( const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => { if (!key) return ''; - if (!key.includes('.')) return key; + if (!key.includes('.') && !namespace) return key; return t(getKey(namespace, key), ...(arg as I18nTranslationRestParameters)); }; return { diff --git a/src/layouts/default/tabs/index.vue b/src/layouts/default/tabs/index.vue index ba01ceb174250d70a33de95e11facd81d8055a7f..ffa61cb6304b930565c1271caa81bec2fdf62efa 100644 --- a/src/layouts/default/tabs/index.vue +++ b/src/layouts/default/tabs/index.vue @@ -91,7 +91,7 @@ const isHide = !hideTab ? null : currentActiveMenu; const p = isHide || fullPath || path; if (activeKeyRef.value !== p) { - activeKeyRef.value = p; + activeKeyRef.value = p as string; } if (isHide) { diff --git a/src/router/menus/index.ts b/src/router/menus/index.ts index 940c4f1e9724031580d2e9979a405bf1d3c78ed0..ef3deb00a399d493d5bcd4125ffcd36d4df5cd3e 100644 --- a/src/router/menus/index.ts +++ b/src/router/menus/index.ts @@ -99,7 +99,7 @@ function basicFilter(routes: RouteRecordNormalized[]) { }); if (!matchRoute) return false; - menu.icon = menu.icon || matchRoute.meta.icon; + menu.icon = (menu.icon || matchRoute.meta.icon) as string; menu.meta = matchRoute.meta; return true; }; diff --git a/src/store/modules/tab.ts b/src/store/modules/tab.ts index e6aa3dffab8389c0f8e505745896e53b2ff236dc..8d4aae150ca6f54b1146d79fd50712f8c9545dbc 100644 --- a/src/store/modules/tab.ts +++ b/src/store/modules/tab.ts @@ -124,7 +124,7 @@ class Tab extends VuexModule { const { path, fullPath, params, query } = route; let updateIndex = -1; - // 已经存在的页面,不重复添加tab + // Existing pages, do not add tabs repeatedly const hasTab = this.tabsState.some((tab, index) => { updateIndex = index; return (tab.fullPath || tab.path) === (fullPath || path); diff --git a/vite.config.ts b/vite.config.ts index 99c4e8c325abaed32ecb2b96405d804af8953919..927c1ea559b130fff88e3e9b6ccb242e802d92ea 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -91,7 +91,13 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { optimizeDeps: { // @iconify/iconify: The dependency is dynamically and virtually loaded by @purge-icons/generated, so it needs to be specified explicitly - include: ['@iconify/iconify'], + include: [ + '@iconify/iconify', + 'ant-design-vue/es/locale/zh_CN', + 'moment/dist/locale/zh-cn', + 'ant-design-vue/es/locale/en_US', + 'moment/dist/locale/eu', + ], exclude: ['vue-demi'], }, }; diff --git a/yarn.lock b/yarn.lock index f92706ddd6464ee3255d3e1f1dc478d4c88fc47d..94adeadae6889ddeb66f1acb98e913dddba36564 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6985,9 +6985,9 @@ postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.21, postcss@^7.0. supports-color "^6.1.0" postcss@^8.2.1: - version "8.2.4" - resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.4.tgz#20a98a39cf303d15129c2865a9ec37eda0031d04" - integrity sha512-kRFftRoExRVXZlwUuay9iC824qmXPcQQVzAjbCCgjpXnkdMCJYBu2gTwAaFBzv8ewND6O8xFb3aELmEkh9zTzg== + version "8.2.6" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.6.tgz#5d69a974543b45f87e464bc4c3e392a97d6be9fe" + integrity sha512-xpB8qYxgPuly166AGlpRjUdEYtmOWx2iCwGmrv4vqZL9YPVviDVPZPRXxnXr6xPZOdxQ9lp3ZBFCRgWJ7LE3Sg== dependencies: colorette "^1.2.1" nanoid "^3.1.20" @@ -7518,9 +7518,9 @@ rollup@^2.25.0: fsevents "~2.1.2" rollup@^2.38.5: - version "2.38.5" - resolved "https://registry.npmjs.org/rollup/-/rollup-2.38.5.tgz#be41ad4fe0c103a8794377afceb5f22b8f603d6a" - integrity sha512-VoWt8DysFGDVRGWuHTqZzT02J0ASgjVq/hPs9QcBOGMd7B+jfTr/iqMVEyOi901rE3xq+Deq66GzIT1yt7sGwQ== + version "2.40.0" + resolved "https://registry.npmjs.org/rollup/-/rollup-2.40.0.tgz#efc218eaede7ab590954df50f96195188999c304" + integrity sha512-WiOGAPbXoHu+TOz6hyYUxIksOwsY/21TRWoO593jgYt8mvYafYqQl+axaA8y1z2HFazNUUrsMSjahV2A6/2R9A== optionalDependencies: fsevents "~2.3.1" @@ -8982,7 +8982,7 @@ vite-plugin-windicss@0.6.2: "@windicss/plugin-utils" "0.6.2" windicss "^2.2.0" -vite@2.0.4: +vite@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/vite/-/vite-2.0.4.tgz#063532a4139b59a067297d8ebb5960d450907a09" integrity sha512-+PP89D7AKXFE4gps8c5+4eP5yXTh5qCogjdYX7iSsIxbLZAa26JoGSq6OLk0qdb/fqDh7gtJqGiLbG2V6NvkKQ==