This commit is contained in:
132
web-src/types/global-components.d.ts
vendored
Normal file
132
web-src/types/global-components.d.ts
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
declare module "vue" {
|
||||
/**
|
||||
* 自定义全局组件获得 Volar 提示(自定义的全局组件需要在这里声明下才能获得 Volar 类型提示哦)
|
||||
*/
|
||||
export interface GlobalComponents {
|
||||
IconifyIconOffline: (typeof import("../src/components/ReIcon"))["IconifyIconOffline"];
|
||||
IconifyIconOnline: (typeof import("../src/components/ReIcon"))["IconifyIconOnline"];
|
||||
FontIcon: (typeof import("../src/components/ReIcon"))["FontIcon"];
|
||||
Auth: (typeof import("../src/components/ReAuth"))["Auth"];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO https://github.com/element-plus/element-plus/blob/dev/global.d.ts#L2
|
||||
* No need to install @vue/runtime-core
|
||||
*/
|
||||
declare module "vue" {
|
||||
export interface GlobalComponents {
|
||||
ElAffix: (typeof import("element-plus"))["ElAffix"];
|
||||
ElAlert: (typeof import("element-plus"))["ElAlert"];
|
||||
ElAside: (typeof import("element-plus"))["ElAside"];
|
||||
ElAutocomplete: (typeof import("element-plus"))["ElAutocomplete"];
|
||||
ElAvatar: (typeof import("element-plus"))["ElAvatar"];
|
||||
ElAnchor: (typeof import("element-plus"))["ElAnchor"];
|
||||
ElAnchorLink: (typeof import("element-plus"))["ElAnchorLink"];
|
||||
ElBacktop: (typeof import("element-plus"))["ElBacktop"];
|
||||
ElBadge: (typeof import("element-plus"))["ElBadge"];
|
||||
ElBreadcrumb: (typeof import("element-plus"))["ElBreadcrumb"];
|
||||
ElBreadcrumbItem: (typeof import("element-plus"))["ElBreadcrumbItem"];
|
||||
ElButton: (typeof import("element-plus"))["ElButton"];
|
||||
ElButtonGroup: (typeof import("element-plus"))["ElButtonGroup"];
|
||||
ElCalendar: (typeof import("element-plus"))["ElCalendar"];
|
||||
ElCard: (typeof import("element-plus"))["ElCard"];
|
||||
ElCarousel: (typeof import("element-plus"))["ElCarousel"];
|
||||
ElCarouselItem: (typeof import("element-plus"))["ElCarouselItem"];
|
||||
ElCascader: (typeof import("element-plus"))["ElCascader"];
|
||||
ElCascaderPanel: (typeof import("element-plus"))["ElCascaderPanel"];
|
||||
ElCheckbox: (typeof import("element-plus"))["ElCheckbox"];
|
||||
ElCheckboxButton: (typeof import("element-plus"))["ElCheckboxButton"];
|
||||
ElCheckboxGroup: (typeof import("element-plus"))["ElCheckboxGroup"];
|
||||
ElCol: (typeof import("element-plus"))["ElCol"];
|
||||
ElCollapse: (typeof import("element-plus"))["ElCollapse"];
|
||||
ElCollapseItem: (typeof import("element-plus"))["ElCollapseItem"];
|
||||
ElCollapseTransition: (typeof import("element-plus"))["ElCollapseTransition"];
|
||||
ElColorPicker: (typeof import("element-plus"))["ElColorPicker"];
|
||||
ElContainer: (typeof import("element-plus"))["ElContainer"];
|
||||
ElConfigProvider: (typeof import("element-plus"))["ElConfigProvider"];
|
||||
ElDatePicker: (typeof import("element-plus"))["ElDatePicker"];
|
||||
ElDialog: (typeof import("element-plus"))["ElDialog"];
|
||||
ElDivider: (typeof import("element-plus"))["ElDivider"];
|
||||
ElDrawer: (typeof import("element-plus"))["ElDrawer"];
|
||||
ElDropdown: (typeof import("element-plus"))["ElDropdown"];
|
||||
ElDropdownItem: (typeof import("element-plus"))["ElDropdownItem"];
|
||||
ElDropdownMenu: (typeof import("element-plus"))["ElDropdownMenu"];
|
||||
ElEmpty: (typeof import("element-plus"))["ElEmpty"];
|
||||
ElFooter: (typeof import("element-plus"))["ElFooter"];
|
||||
ElForm: (typeof import("element-plus"))["ElForm"];
|
||||
ElFormItem: (typeof import("element-plus"))["ElFormItem"];
|
||||
ElHeader: (typeof import("element-plus"))["ElHeader"];
|
||||
ElIcon: (typeof import("element-plus"))["ElIcon"];
|
||||
ElImage: (typeof import("element-plus"))["ElImage"];
|
||||
ElImageViewer: (typeof import("element-plus"))["ElImageViewer"];
|
||||
ElInput: (typeof import("element-plus"))["ElInput"];
|
||||
ElInputNumber: (typeof import("element-plus"))["ElInputNumber"];
|
||||
ElLink: (typeof import("element-plus"))["ElLink"];
|
||||
ElMain: (typeof import("element-plus"))["ElMain"];
|
||||
ElMenu: (typeof import("element-plus"))["ElMenu"];
|
||||
ElMenuItem: (typeof import("element-plus"))["ElMenuItem"];
|
||||
ElMenuItemGroup: (typeof import("element-plus"))["ElMenuItemGroup"];
|
||||
ElOption: (typeof import("element-plus"))["ElOption"];
|
||||
ElOptionGroup: (typeof import("element-plus"))["ElOptionGroup"];
|
||||
ElPageHeader: (typeof import("element-plus"))["ElPageHeader"];
|
||||
ElPagination: (typeof import("element-plus"))["ElPagination"];
|
||||
ElPopconfirm: (typeof import("element-plus"))["ElPopconfirm"];
|
||||
ElPopper: (typeof import("element-plus"))["ElPopper"];
|
||||
ElPopover: (typeof import("element-plus"))["ElPopover"];
|
||||
ElProgress: (typeof import("element-plus"))["ElProgress"];
|
||||
ElRadio: (typeof import("element-plus"))["ElRadio"];
|
||||
ElRadioButton: (typeof import("element-plus"))["ElRadioButton"];
|
||||
ElRadioGroup: (typeof import("element-plus"))["ElRadioGroup"];
|
||||
ElRate: (typeof import("element-plus"))["ElRate"];
|
||||
ElRow: (typeof import("element-plus"))["ElRow"];
|
||||
ElScrollbar: (typeof import("element-plus"))["ElScrollbar"];
|
||||
ElSelect: (typeof import("element-plus"))["ElSelect"];
|
||||
ElSlider: (typeof import("element-plus"))["ElSlider"];
|
||||
ElStep: (typeof import("element-plus"))["ElStep"];
|
||||
ElSteps: (typeof import("element-plus"))["ElSteps"];
|
||||
ElSubMenu: (typeof import("element-plus"))["ElSubMenu"];
|
||||
ElSwitch: (typeof import("element-plus"))["ElSwitch"];
|
||||
ElTabPane: (typeof import("element-plus"))["ElTabPane"];
|
||||
ElTable: (typeof import("element-plus"))["ElTable"];
|
||||
ElTableColumn: (typeof import("element-plus"))["ElTableColumn"];
|
||||
ElTabs: (typeof import("element-plus"))["ElTabs"];
|
||||
ElTag: (typeof import("element-plus"))["ElTag"];
|
||||
ElText: (typeof import("element-plus"))["ElText"];
|
||||
ElTimePicker: (typeof import("element-plus"))["ElTimePicker"];
|
||||
ElTimeSelect: (typeof import("element-plus"))["ElTimeSelect"];
|
||||
ElTimeline: (typeof import("element-plus"))["ElTimeline"];
|
||||
ElTimelineItem: (typeof import("element-plus"))["ElTimelineItem"];
|
||||
ElTooltip: (typeof import("element-plus"))["ElTooltip"];
|
||||
ElTransfer: (typeof import("element-plus"))["ElTransfer"];
|
||||
ElTree: (typeof import("element-plus"))["ElTree"];
|
||||
ElTreeV2: (typeof import("element-plus"))["ElTreeV2"];
|
||||
ElTreeSelect: (typeof import("element-plus"))["ElTreeSelect"];
|
||||
ElUpload: (typeof import("element-plus"))["ElUpload"];
|
||||
ElSpace: (typeof import("element-plus"))["ElSpace"];
|
||||
ElSkeleton: (typeof import("element-plus"))["ElSkeleton"];
|
||||
ElSkeletonItem: (typeof import("element-plus"))["ElSkeletonItem"];
|
||||
ElStatistic: (typeof import("element-plus"))["ElStatistic"];
|
||||
ElCheckTag: (typeof import("element-plus"))["ElCheckTag"];
|
||||
ElDescriptions: (typeof import("element-plus"))["ElDescriptions"];
|
||||
ElDescriptionsItem: (typeof import("element-plus"))["ElDescriptionsItem"];
|
||||
ElResult: (typeof import("element-plus"))["ElResult"];
|
||||
ElSelectV2: (typeof import("element-plus"))["ElSelectV2"];
|
||||
ElWatermark: (typeof import("element-plus"))["ElWatermark"];
|
||||
ElTour: (typeof import("element-plus"))["ElTour"];
|
||||
ElTourStep: (typeof import("element-plus"))["ElTourStep"];
|
||||
}
|
||||
|
||||
interface ComponentCustomProperties {
|
||||
$message: (typeof import("element-plus"))["ElMessage"];
|
||||
$notify: (typeof import("element-plus"))["ElNotification"];
|
||||
$msgbox: (typeof import("element-plus"))["ElMessageBox"];
|
||||
$messageBox: (typeof import("element-plus"))["ElMessageBox"];
|
||||
$alert: (typeof import("element-plus"))["ElMessageBox"]["alert"];
|
||||
$confirm: (typeof import("element-plus"))["ElMessageBox"]["confirm"];
|
||||
$prompt: (typeof import("element-plus"))["ElMessageBox"]["prompt"];
|
||||
$loading: (typeof import("element-plus"))["ElLoadingService"];
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
193
web-src/types/global.d.ts
vendored
Normal file
193
web-src/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
import type { ECharts } from "echarts";
|
||||
import type { TableColumns } from "@pureadmin/table";
|
||||
|
||||
/**
|
||||
* 全局类型声明,无需引入直接在 `.vue` 、`.ts` 、`.tsx` 文件使用即可获得类型提示
|
||||
*/
|
||||
declare global {
|
||||
/**
|
||||
* 平台的名称、版本、运行所需的`node`和`pnpm`版本、依赖、最后构建时间的类型提示
|
||||
*/
|
||||
const __APP_INFO__: {
|
||||
pkg: {
|
||||
name: string;
|
||||
version: string;
|
||||
engines: {
|
||||
node: string;
|
||||
pnpm: string;
|
||||
};
|
||||
dependencies: Recordable<string>;
|
||||
devDependencies: Recordable<string>;
|
||||
};
|
||||
lastBuildTime: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Window 的类型提示
|
||||
*/
|
||||
interface Window {
|
||||
// Global vue app instance
|
||||
__APP__: App<Element>;
|
||||
webkitCancelAnimationFrame: (handle: number) => void;
|
||||
mozCancelAnimationFrame: (handle: number) => void;
|
||||
oCancelAnimationFrame: (handle: number) => void;
|
||||
msCancelAnimationFrame: (handle: number) => void;
|
||||
webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
||||
mozRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
||||
oRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
||||
msRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Document 的类型提示
|
||||
*/
|
||||
interface Document {
|
||||
webkitFullscreenElement?: Element;
|
||||
mozFullScreenElement?: Element;
|
||||
msFullscreenElement?: Element;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打包压缩格式的类型声明
|
||||
*/
|
||||
type ViteCompression =
|
||||
| "none"
|
||||
| "gzip"
|
||||
| "brotli"
|
||||
| "both"
|
||||
| "gzip-clear"
|
||||
| "brotli-clear"
|
||||
| "both-clear";
|
||||
|
||||
/**
|
||||
* 全局自定义环境变量的类型声明
|
||||
* @see {@link https://pure-admin.github.io/pure-admin-doc/pages/config/#%E5%85%B7%E4%BD%93%E9%85%8D%E7%BD%AE}
|
||||
*/
|
||||
interface ViteEnv {
|
||||
VITE_PORT: number;
|
||||
VITE_PUBLIC_PATH: string;
|
||||
VITE_ROUTER_HISTORY: string;
|
||||
VITE_CDN: boolean;
|
||||
VITE_HIDE_HOME: string;
|
||||
VITE_COMPRESSION: ViteCompression;
|
||||
}
|
||||
|
||||
/**
|
||||
* 继承 `@pureadmin/table` 的 `TableColumns` ,方便全局直接调用
|
||||
*/
|
||||
interface TableColumnList extends Array<TableColumns> {}
|
||||
|
||||
/**
|
||||
* 对应 `public/platform-config.json` 文件的类型声明
|
||||
* @see {@link https://pure-admin.github.io/pure-admin-doc/pages/config/#platform-config-json}
|
||||
*/
|
||||
interface PlatformConfigs {
|
||||
Version?: string;
|
||||
Title?: string;
|
||||
FixedHeader?: boolean;
|
||||
HiddenSideBar?: boolean;
|
||||
MultiTagsCache?: boolean;
|
||||
MaxTagsLevel?: number;
|
||||
KeepAlive?: boolean;
|
||||
Locale?: string;
|
||||
Layout?: string;
|
||||
Theme?: string;
|
||||
DarkMode?: boolean;
|
||||
OverallStyle?: string;
|
||||
Grey?: boolean;
|
||||
Weak?: boolean;
|
||||
HideTabs?: boolean;
|
||||
HideFooter?: boolean;
|
||||
Stretch?: boolean | number;
|
||||
SidebarStatus?: boolean;
|
||||
EpThemeColor?: string;
|
||||
ShowLogo?: boolean;
|
||||
ShowModel?: string;
|
||||
MenuArrowIconNoTransition?: boolean;
|
||||
CachingAsyncRoutes?: boolean;
|
||||
TooltipEffect?: Effect;
|
||||
ResponsiveStorageNameSpace?: string;
|
||||
MenuSearchHistory?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 与 `PlatformConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
|
||||
* @see {@link https://pure-admin.github.io/pure-admin-doc/pages/config/#platform-config-json}
|
||||
*/
|
||||
interface StorageConfigs {
|
||||
version?: string;
|
||||
title?: string;
|
||||
fixedHeader?: boolean;
|
||||
hiddenSideBar?: boolean;
|
||||
multiTagsCache?: boolean;
|
||||
keepAlive?: boolean;
|
||||
locale?: string;
|
||||
layout?: string;
|
||||
theme?: string;
|
||||
darkMode?: boolean;
|
||||
grey?: boolean;
|
||||
weak?: boolean;
|
||||
hideTabs?: boolean;
|
||||
hideFooter?: boolean;
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
themeColor?: string;
|
||||
overallStyle?: string;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
menuSearchHistory?: number;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* `responsive-storage` 本地响应式 `storage` 的类型声明
|
||||
*/
|
||||
interface ResponsiveStorage {
|
||||
locale: {
|
||||
locale?: string;
|
||||
};
|
||||
layout: {
|
||||
layout?: string;
|
||||
theme?: string;
|
||||
darkMode?: boolean;
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
themeColor?: string;
|
||||
overallStyle?: string;
|
||||
};
|
||||
configure: {
|
||||
grey?: boolean;
|
||||
weak?: boolean;
|
||||
hideTabs?: boolean;
|
||||
hideFooter?: boolean;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
multiTagsCache?: boolean;
|
||||
stretch?: boolean | number;
|
||||
};
|
||||
tags?: Array<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台里所有组件实例都能访问到的全局属性对象的类型声明
|
||||
*/
|
||||
interface GlobalPropertiesApi {
|
||||
$echarts: ECharts;
|
||||
$storage: ResponsiveStorage;
|
||||
$config: PlatformConfigs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展 `Element`
|
||||
*/
|
||||
interface Element {
|
||||
// v-ripple 作用于 src/directives/ripple/index.ts 文件
|
||||
_ripple?: {
|
||||
enabled?: boolean;
|
||||
centered?: boolean;
|
||||
class?: string;
|
||||
circle?: boolean;
|
||||
touched?: boolean;
|
||||
};
|
||||
}
|
||||
}
|
80
web-src/types/index.d.ts
vendored
Normal file
80
web-src/types/index.d.ts
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
// 此文件跟同级目录的 global.d.ts 文件一样也是全局类型声明,只不过这里存放一些零散的全局类型,无需引入直接在 .vue 、.ts 、.tsx 文件使用即可获得类型提示
|
||||
|
||||
type RefType<T> = T | null;
|
||||
|
||||
type EmitType = (event: string, ...args: any[]) => void;
|
||||
|
||||
type TargetContext = "_self" | "_blank";
|
||||
|
||||
type ComponentRef<T extends HTMLElement = HTMLDivElement> =
|
||||
ComponentElRef<T> | null;
|
||||
|
||||
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
|
||||
|
||||
type ForDataType<T> = {
|
||||
[P in T]?: ForDataType<T[P]>;
|
||||
};
|
||||
|
||||
type AnyFunction<T> = (...args: any[]) => T;
|
||||
|
||||
type PropType<T> = VuePropType<T>;
|
||||
|
||||
type Writable<T> = {
|
||||
-readonly [P in keyof T]: T[P];
|
||||
};
|
||||
|
||||
type Nullable<T> = T | null;
|
||||
|
||||
type NonNullable<T> = T extends null | undefined ? never : T;
|
||||
|
||||
type Recordable<T = any> = Record<string, T>;
|
||||
|
||||
type ReadonlyRecordable<T = any> = {
|
||||
readonly [key: string]: T;
|
||||
};
|
||||
|
||||
type Indexable<T = any> = {
|
||||
[key: string]: T;
|
||||
};
|
||||
|
||||
type DeepPartial<T> = {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
};
|
||||
|
||||
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
|
||||
|
||||
type Exclusive<T, U> = (Without<T, U> & U) | (Without<U, T> & T);
|
||||
|
||||
type TimeoutHandle = ReturnType<typeof setTimeout>;
|
||||
|
||||
type IntervalHandle = ReturnType<typeof setInterval>;
|
||||
|
||||
type Effect = "light" | "dark";
|
||||
|
||||
interface ChangeEvent extends Event {
|
||||
target: HTMLInputElement;
|
||||
}
|
||||
|
||||
interface WheelEvent {
|
||||
path?: EventTarget[];
|
||||
}
|
||||
|
||||
interface ImportMetaEnv extends ViteEnv {
|
||||
__: unknown;
|
||||
}
|
||||
|
||||
interface Fn<T = any, R = T> {
|
||||
(...arg: T[]): R;
|
||||
}
|
||||
|
||||
interface PromiseFn<T = any, R = T> {
|
||||
(...arg: T[]): Promise<R>;
|
||||
}
|
||||
|
||||
interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
|
||||
$el: T;
|
||||
}
|
||||
|
||||
// function parseInt(s: string | number, radix?: number): number;
|
||||
|
||||
// function parseFloat(string: string | number): number;
|
108
web-src/types/router.d.ts
vendored
Normal file
108
web-src/types/router.d.ts
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
// 全局路由类型声明
|
||||
|
||||
import type { RouteComponent, RouteLocationNormalized } from "vue-router";
|
||||
import type { FunctionalComponent } from "vue";
|
||||
|
||||
declare global {
|
||||
interface ToRouteType extends RouteLocationNormalized {
|
||||
meta: CustomizeRouteMeta;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 完整子路由的`meta`配置表
|
||||
*/
|
||||
interface CustomizeRouteMeta {
|
||||
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加) `必填` */
|
||||
title: string;
|
||||
/** 菜单图标 `可选` */
|
||||
icon?: string | FunctionalComponent | IconifyIcon;
|
||||
/** 菜单名称右侧的额外图标 */
|
||||
extraIcon?: string | FunctionalComponent | IconifyIcon;
|
||||
/** 是否在菜单中显示(默认`true`)`可选` */
|
||||
showLink?: boolean;
|
||||
/** 是否显示父级菜单 `可选` */
|
||||
showParent?: boolean;
|
||||
/** 页面级别权限设置 `可选` */
|
||||
roles?: Array<string>;
|
||||
/** 按钮级别权限设置 `可选` */
|
||||
auths?: Array<string>;
|
||||
/** 路由组件缓存(开启 `true`、关闭 `false`)`可选` */
|
||||
keepAlive?: boolean;
|
||||
/** 内嵌的`iframe`链接 `可选` */
|
||||
frameSrc?: string;
|
||||
/** `iframe`页是否开启首次加载动画(默认`true`)`可选` */
|
||||
frameLoading?: boolean;
|
||||
/** 页面加载动画(两种模式,第二种权重更高,第一种直接采用`vue`内置的`transitions`动画,第二种是使用`animate.css`编写进、离场动画,平台更推荐使用第二种模式,已经内置了`animate.css`,直接写对应的动画名即可)`可选` */
|
||||
transition?: {
|
||||
/**
|
||||
* @description 当前路由动画效果
|
||||
* @see {@link https://next.router.vuejs.org/guide/advanced/transitions.html#transitions}
|
||||
* @see animate.css {@link https://animate.style}
|
||||
*/
|
||||
name?: string;
|
||||
/** 进场动画 */
|
||||
enterTransition?: string;
|
||||
/** 离场动画 */
|
||||
leaveTransition?: string;
|
||||
};
|
||||
/** 当前菜单名称或自定义信息禁止添加到标签页(默认`false`) */
|
||||
hiddenTag?: boolean;
|
||||
/** 当前菜单名称是否固定显示在标签页且不可关闭(默认`false`) */
|
||||
fixedTag?: boolean;
|
||||
/** 动态路由可打开的最大数量 `可选` */
|
||||
dynamicLevel?: number;
|
||||
/** 将某个菜单激活
|
||||
* (主要用于通过`query`或`params`传参的路由,当它们通过配置`showLink: false`后不在菜单中显示,就不会有任何菜单高亮,
|
||||
* 而通过设置`activePath`指定激活菜单即可获得高亮,`activePath`为指定激活菜单的`path`)
|
||||
*/
|
||||
activePath?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 完整子路由配置表
|
||||
*/
|
||||
interface RouteChildrenConfigsTable {
|
||||
/** 子路由地址 `必填` */
|
||||
path: string;
|
||||
/** 路由名字(对应不要重复,和当前组件的`name`保持一致)`必填` */
|
||||
name?: string;
|
||||
/** 路由重定向 `可选` */
|
||||
redirect?: string;
|
||||
/** 按需加载组件 `可选` */
|
||||
component?: RouteComponent;
|
||||
meta?: CustomizeRouteMeta;
|
||||
/** 子路由配置项 */
|
||||
children?: Array<RouteChildrenConfigsTable>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 整体路由配置表(包括完整子路由)
|
||||
*/
|
||||
interface RouteConfigsTable {
|
||||
/** 路由地址 `必填` */
|
||||
path: string;
|
||||
/** 路由名字(保持唯一)`可选` */
|
||||
name?: string;
|
||||
/** `Layout`组件 `可选` */
|
||||
component?: RouteComponent;
|
||||
/** 路由重定向 `可选` */
|
||||
redirect?: string;
|
||||
meta?: {
|
||||
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加)`必填` */
|
||||
title: string;
|
||||
/** 菜单图标 `可选` */
|
||||
icon?: string | FunctionalComponent | IconifyIcon;
|
||||
/** 是否在菜单中显示(默认`true`)`可选` */
|
||||
showLink?: boolean;
|
||||
/** 菜单升序排序,值越高排的越后(只针对顶级路由)`可选` */
|
||||
rank?: number;
|
||||
};
|
||||
/** 子路由配置项 */
|
||||
children?: Array<RouteChildrenConfigsTable>;
|
||||
}
|
||||
}
|
||||
|
||||
// https://router.vuejs.org/zh/guide/advanced/meta.html#typescript
|
||||
declare module "vue-router" {
|
||||
interface RouteMeta extends CustomizeRouteMeta {}
|
||||
}
|
23
web-src/types/shims-tsx.d.ts
vendored
Normal file
23
web-src/types/shims-tsx.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { VNode } from "vue";
|
||||
import type Vue from "vue";
|
||||
|
||||
declare module "*.tsx" {
|
||||
import Vue from "compatible-vue";
|
||||
export default Vue;
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface Element extends VNode {}
|
||||
interface ElementClass extends Vue {}
|
||||
interface ElementAttributesProperty {
|
||||
$props: any;
|
||||
}
|
||||
interface IntrinsicElements {
|
||||
[elem: string]: any;
|
||||
}
|
||||
interface IntrinsicAttributes {
|
||||
[elem: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
10
web-src/types/shims-vue.d.ts
vendored
Normal file
10
web-src/types/shims-vue.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
declare module "*.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module "*.scss" {
|
||||
const scss: Record<string, string>;
|
||||
export default scss;
|
||||
}
|
Reference in New Issue
Block a user