30 lines
894 B
TypeScript
30 lines
894 B
TypeScript
/// <reference types="vite/client" />
|
|
/// <reference types="axios" />
|
|
/// <reference types="vue-router/auto" />
|
|
|
|
// 全局变量:由 src/config/index.ts 的 useConfig() 与 src/Index.vue 注册,
|
|
// 使用时不需 import(均挂载在 window 上)
|
|
declare global {
|
|
// API 聚合对象:$http.<模块>.<函数>(),模块见 src/api/*/index.ts
|
|
let $http: any;
|
|
// vue3-cookies 封装:$cookies.get/set/remove
|
|
let $cookies: any;
|
|
// naive-ui useMessage 实例:$msg.success/warning/error/info
|
|
let $msg: any;
|
|
// pinia store 聚合:$store.nav.useNavStore() / $store.log.useLogStore()
|
|
let $store: any;
|
|
// 全局弹窗:$modal({ title, content, contType: 'text'|'input', ... })
|
|
let $modal: any;
|
|
interface Window {
|
|
// 扩展Windows环境下的全局$http对象
|
|
$http: any;
|
|
$cookies: any;
|
|
$msg: any;
|
|
$store: any;
|
|
$modal: any;
|
|
}
|
|
}
|
|
|
|
export { };
|
|
|