陈文彬
2020-10-01 2f268ca8f43d98687ffd809e2c1d140d29033bd6
提交 | 用户 | age
2f6253 1 import type { RouteRecordRaw } from 'vue-router';
2 import { RoleEnum } from '/@/enums/roleEnum';
3 export interface RouteMeta {
4   // title
5   title: string;
6   // Whether to ignore permissions
7   ignoreAuth?: boolean;
8   // role info
9   roles?: RoleEnum[];
10   // Whether not to cache
11   ignoreKeepAlive?: boolean;
12   // Is it fixed on tab
13   affix?: boolean;
14   // icon on tab
15   icon?: string;
16   // Jump address
17   frameSrc?: string;
18   // Outer link jump address
19   externalLink?: string;
20
21   // current page transition
22   transitionName?: string;
23
24   // Whether the route has been dynamically added
25   hideBreadcrumb?: boolean;
26
27   // disabled redirect
28   disabledRedirect?: boolean;
2f268c 29
30   // close loading
31   afterCloseLoading?: boolean;
2f6253 32 }
33
34 export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
35   meta: RouteMeta;
36   component?: any;
37   components?: any;
38   children?: AppRouteRecordRaw[];
39   props?: any;
40 }
41
42 export interface Menu {
43   name: string;
44
45   icon?: string;
46
47   path: string;
48
49   disabled?: boolean;
50
51   children?: Menu[];
52
53   orderNo?: number;
54
55   roles?: RoleEnum[];
56
57   meta?: Partial<RouteMeta>;
58 }
59 export interface MenuModule {
60   orderNo?: number;
61   menu: Menu;
62 }
63
64 export interface AppRouteModule {
65   layout: AppRouteRecordRaw;
66   routes: AppRouteRecordRaw[];
67 }