diff --git a/frontend/src/components/staticExtend/SvgIcon/index.ts b/frontend/src/components/StaticExtend/SvgIcon/index.ts similarity index 100% rename from frontend/src/components/staticExtend/SvgIcon/index.ts rename to frontend/src/components/StaticExtend/SvgIcon/index.ts diff --git a/frontend/src/components/staticExtend/SvgIcon/src/SvgIcon.vue b/frontend/src/components/StaticExtend/SvgIcon/src/SvgIcon.vue similarity index 100% rename from frontend/src/components/staticExtend/SvgIcon/src/SvgIcon.vue rename to frontend/src/components/StaticExtend/SvgIcon/src/SvgIcon.vue diff --git a/frontend/src/components/index.ts b/frontend/src/components/index.ts index b4c8ad3..bf1ba75 100644 --- a/frontend/src/components/index.ts +++ b/frontend/src/components/index.ts @@ -1,7 +1,7 @@ import type { App, Component } from 'vue' // 当组件很多的时候,可以使用 -import { SvgIcon } from './staticExtend/SvgIcon' +import { SvgIcon } from '@/components/StaticExtend/SvgIcon' // 这个地方将合并到对象中 const Components: { diff --git a/frontend/src/types/components.d.ts b/frontend/src/types/components.d.ts index 2fda744..dd4ada1 100644 --- a/frontend/src/types/components.d.ts +++ b/frontend/src/types/components.d.ts @@ -67,7 +67,7 @@ declare module 'vue' { RouterView: typeof import('vue-router')['RouterView'] SearchForm: typeof import('../components/SearchForm/index.vue')['default'] SearchFormItem: typeof import('../components/SearchForm/components/SearchFormItem.vue')['default'] - SvgIcon: typeof import('../components/staticExtend/SvgIcon/src/SvgIcon.vue')['default'] + SvgIcon: typeof import('@/components/StaticExtend/SvgIcon/src/SvgIcon.vue')['default'] SwitchDark: typeof import('../components/SwitchDark/index.vue')['default'] TableColumn: typeof import('../components/ProTable/components/TableColumn.vue')['default'] } diff --git a/frontend/src/types/env.d.ts b/frontend/src/types/env.d.ts index 98a8612..be1365c 100644 --- a/frontend/src/types/env.d.ts +++ b/frontend/src/types/env.d.ts @@ -1,23 +1,26 @@ - -declare module "*.vue" { - import { DefineComponent } from "vue"; +declare module '*.vue' { + import { DefineComponent } from 'vue' // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types - const component: DefineComponent<{}, {}, any>; - export default component; + const component: DefineComponent<{}, {}, any> + export default component } /* Vite */ declare type Recordable = Record; + + + + declare interface ViteEnv { - VITE_USER_NODE_ENV: "development" | "production" | "test"; + VITE_USER_NODE_ENV: 'development' | 'production' | 'test'; VITE_GLOB_APP_TITLE: string; VITE_PORT: number; VITE_OPEN: boolean; VITE_REPORT: boolean; - VITE_ROUTER_MODE: "hash" | "history"; - VITE_BUILD_COMPRESS: "gzip" | "brotli" | "gzip,brotli" | "none"; + VITE_ROUTER_MODE: 'hash' | 'history'; + VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'gzip,brotli' | 'none'; VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean; VITE_DROP_CONSOLE: boolean; VITE_PWA: boolean; @@ -30,6 +33,10 @@ interface ImportMetaEnv extends ViteEnv { __: unknown; } +interface ImportMeta { + readonly env: ImportMetaEnv; +} + /* __APP_INFO__ */ declare const __APP_INFO__: { pkg: { @@ -39,4 +46,4 @@ declare const __APP_INFO__: { devDependencies: Recordable; }; lastBuildTime: string; -}; +} diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index c722012..0f7bbeb 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -25,6 +25,7 @@ "noEmit": false, "types": [ "node", + "vite/client", "element-plus/global" ], "baseUrl": "./", // 解析非相对模块的基地址,默认是当前目录