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