Vben
2021-06-19 7dce50cb1f70da050bef689deac29de397005f8b
提交 | 用户 | age
7dce50 1 import type { RouteRecordRaw, RouteMeta } from 'vue-router';
2f6253 2 import { RoleEnum } from '/@/enums/roleEnum';
be3a3e 3 import { defineComponent } from 'vue';
V 4
5 export type Component<T extends any = any> =
6   | ReturnType<typeof defineComponent>
7   | (() => Promise<typeof import('*.vue')>)
8   | (() => Promise<T>);
2f6253 9
b6e5c3 10 // @ts-ignore
2f6253 11 export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
fc4666 12   name: string;
2f6253 13   meta: RouteMeta;
819bcb 14   component?: Component | string;
c303ec 15   components?: Component;
2f6253 16   children?: AppRouteRecordRaw[];
4ff1c4 17   props?: Recordable;
31e271 18   fullPath?: string;
2f6253 19 }
7dce50 20
a3887f 21 export interface MenuTag {
V 22   type?: 'primary' | 'error' | 'warn' | 'success';
23   content?: string;
24   dot?: boolean;
25 }
2f6253 26
27 export interface Menu {
28   name: string;
29
30   icon?: string;
31
32   path: string;
33
34   disabled?: boolean;
35
36   children?: Menu[];
37
38   orderNo?: number;
39
40   roles?: RoleEnum[];
41
42   meta?: Partial<RouteMeta>;
a3887f 43
V 44   tag?: MenuTag;
7279c0 45
V 46   hideMenu?: boolean;
2f6253 47 }
f7aa93 48
2f6253 49 export interface MenuModule {
50   orderNo?: number;
51   menu: Menu;
52 }
53
c303ec 54 // export type AppRouteModule = RouteModule | AppRouteRecordRaw;
V 55 export type AppRouteModule = AppRouteRecordRaw;