diff --git a/package.json b/package.json index 76306284..046ab291 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,13 @@ "html2canvas": "^1.4.1", "keymaster": "^1.6.2", "monaco-editor": "^0.33.0", - "naive-ui": "2.33.4", + "naive-ui": "2.34.3", "pinia": "^2.0.13", "screenfull": "^6.0.1", "three": "^0.145.0", "vue": "^3.2.31", "vue-demi": "^0.13.1", - "vue-i18n": "9.1.9", + "vue-i18n": "^9.2.2", "vue-router": "4.0.12", "vue3-lazyload": "^0.2.5-beta", "vue3-sketch-ruler": "^1.3.3", @@ -82,4 +82,4 @@ "vue-echarts": "^6.0.2", "vue-tsc": "^0.28.10" } -} \ No newline at end of file +} diff --git a/src/components/GoLangSelect/index.vue b/src/components/GoLangSelect/index.vue index 7989276a..0cf4a883 100644 --- a/src/components/GoLangSelect/index.vue +++ b/src/components/GoLangSelect/index.vue @@ -14,16 +14,19 @@ diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 06576c37..b6d851c0 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -23,6 +23,8 @@ export const langList = [ ] const i18n = createI18n({ + legacy: false, + globalInjection:true, locale: langStorage?.lang || lang, fallbackLocale: langStorage?.lang || lang, messages: { diff --git a/src/store/modules/langStore/langStore.ts b/src/store/modules/langStore/langStore.ts index d1795e6c..2b7d2709 100644 --- a/src/store/modules/langStore/langStore.ts +++ b/src/store/modules/langStore/langStore.ts @@ -2,7 +2,6 @@ import { defineStore } from 'pinia' import { lang } from '@/settings/designSetting' import { LangStateType } from './langStore.d' import { LangEnum } from '@/enums/styleEnum' -import i18n from '@/i18n/index' import { setLocalStorage, getLocalStorage, reloadRoutePage } from '@/utils' import { StorageEnum } from '@/enums/storageEnum' import { useSettingStore } from '@/store/modules/settingStore/settingStore' @@ -25,10 +24,8 @@ export const useLangStore = defineStore({ actions: { changeLang(lang: LangEnum): void { const settingStore = useSettingStore() - if (this.lang === lang) return this.lang = lang - i18n.global.locale = lang setLocalStorage(GO_LANG_STORE, this.$state) if (settingStore.getChangeLangReload) { diff --git a/src/views/project/items/components/ProjectItemsCard/index.vue b/src/views/project/items/components/ProjectItemsCard/index.vue index b042d229..63ec3c91 100644 --- a/src/views/project/items/components/ProjectItemsCard/index.vue +++ b/src/views/project/items/components/ProjectItemsCard/index.vue @@ -89,6 +89,7 @@ import { renderIcon, renderLang, requireErrorImg } from '@/utils' import { icon } from '@/plugins' import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn' import { Chartype } from '../../index.d' +import { log } from 'console' const { EllipsisHorizontalCircleSharpIcon, CopyIcon, diff --git a/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts b/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts index 89894b03..16434efd 100644 --- a/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts +++ b/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts @@ -1,7 +1,8 @@ -import { ref, Ref } from 'vue' +import { ref } from 'vue' import { ChartEnum } from '@/enums/pageEnum' import { fetchPathByName, routerTurnByPath } from '@/utils' -import { Chartype } from '../../..' +import { Chartype } from '../../../index.d' + export const useModalDataInit = () => { const modalShow = ref(false) const modalData = ref(null) diff --git a/src/views/project/items/components/ProjectItemsList/index.vue b/src/views/project/items/components/ProjectItemsList/index.vue index dc4f9206..80d0c2ff 100644 --- a/src/views/project/items/components/ProjectItemsList/index.vue +++ b/src/views/project/items/components/ProjectItemsList/index.vue @@ -25,7 +25,7 @@