From 2f2516c32287c1c24719efcd1898463c16320c62 Mon Sep 17 00:00:00 2001 From: lbw Date: Tue, 3 Oct 2023 14:03:46 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20Fixing=20a=20bug.=20#I85DEI=20webstorm?= =?UTF-8?q?=E4=B8=8D=E8=AF=86=E5=88=ABts=E5=85=A8=E5=B1=80=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 2 +- src/types/func.ts | 14 ++++++++++++++ src/types/global.d.ts | 16 +--------------- 3 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 src/types/func.ts diff --git a/src/main.ts b/src/main.ts index a083c029..4da62bad 100644 --- a/src/main.ts +++ b/src/main.ts @@ -46,7 +46,7 @@ other.elSvg(app); app .use(pinia) // pinia 存储 .use(router) // 路由 - .use(ElementPlus, { i18n: i18n.global.t }) // ElementPlus 全局引入 + .use(ElementPlus) // ElementPlus 全局引入 .use(ElementIcons) // elementIcons 图标全局引入 .use(i18n) // 国际化 .mount('#app'); diff --git a/src/types/func.ts b/src/types/func.ts new file mode 100644 index 00000000..73b85644 --- /dev/null +++ b/src/types/func.ts @@ -0,0 +1,14 @@ +// 定义全局属性的类型 +// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars +import { ComponentCustomProperties } from 'vue'; + +declare module '@vue/runtime-core' { + interface ComponentCustomProperties { + parseTime: Function; + parseDate: Function; + dateTimeStr: string; + dateStr: string; + timeStr: string; + baseURL: string; + } +} diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 44969ff9..c613f0ee 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -105,18 +105,4 @@ declare interface TableType { pageSize: number; [key: string]: T; }; -} - -// 定义全局属性的类型 -import { ComponentCustomProperties } from 'vue'; - -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - parseTime: Function; - parseDate: Function; - dateTimeStr: string; - dateStr: string; - timeStr: string; - baseURL: string; - } -} +} \ No newline at end of file