create-iking-admin
Version:
金合技术中台脚手架
68 lines (51 loc) • 1.42 kB
text/typescript
/*
* @Author: wfl
* @LastEditors: wfl
* @description:
* @updateInfo:
* @Date: 2022-08-12 18:42:51
* @LastEditTime: 2022-08-15 15:57:34
*/
import { RoleEnum } from '@/global/enums/roleEnum';
import { defineComponent } from 'vue';
import type { RouteMeta, RouteRecordRaw } from 'vue-router';
export type Component<T = any> =
| ReturnType<typeof defineComponent>
| (() => Promise<typeof import('*.vue')>)
| (() => Promise<T>);
// @ts-ignore
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string;
meta: RouteMeta;
component?: Component | string;
components?: Component;
children?: AppRouteRecordRaw[];
props?: Recordable;
fullPath?: string;
}
export interface MenuTag {
type?: 'primary' | 'error' | 'warn' | 'success';
content?: string;
dot?: boolean;
}
export interface Menu {
[x: string]: string | number | symbol | undefined;
name: string;
icon?: string;
path: string;
// path contains param, auto assignment.
paramPath?: string;
disabled?: boolean;
children?: Menu[];
orderNo?: number;
roles?: RoleEnum[];
meta?: Partial<RouteMeta>;
tag?: MenuTag;
hideMenu?: boolean;
}
export interface MenuModule {
orderNo?: number;
menu: Menu;
}
// export type AppRouteModule = RouteModule | AppRouteRecordRaw;
export type AppRouteModule = AppRouteRecordRaw;