policeSecurity/policeManagement/src/vite-env.d.ts

36 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-08-29 17:06:00 +08:00
/// <reference types="vite/client" />
// vue3导入模块报红解决方案——找不到模块“./XXX.vue”或其相应的类型声明
// 报错原因是typescript 只能理解 .ts 文件,无法理解 .vue文件
// 因此需要给.vue文件加上类型说明文件
declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
declare module 'lodash-es' {
import { includes, isEmpty, ceil, divide } from 'lodash';
export { includes, isEmpty, ceil, divide };
}
2024-08-29 17:06:00 +08:00
interface ImportMetaEnv {
// 项目名称
readonly VITE_APP_NAME: string;
// 当前环境
readonly VITE_APP_ENV: 'development' | 'production';
// 启动端口
readonly VITE_APP_PORT: number;
// axios
readonly VITE_APP_BASE_API: string;
readonly VITE_APP_PROXY_URL: string;
// RSA公钥
readonly VITE_APP_RSA_PUBLIC_KEY: string;
}