vben
2020-12-23 b6e5c3f625f3e30b1fa7433e57b1294a8ce8d04b
提交 | 用户 | age
2f6253 1 import type { RouteRecordRaw } from 'vue-router';
2 import { RoleEnum } from '/@/enums/roleEnum';
b6e5c3 3
V 4 import type { Component } from '/@/components/types';
5
2f6253 6 export interface RouteMeta {
7   // title
8   title: string;
9   // Whether to ignore permissions
10   ignoreAuth?: boolean;
11   // role info
12   roles?: RoleEnum[];
13   // Whether not to cache
14   ignoreKeepAlive?: boolean;
15   // Is it fixed on tab
16   affix?: boolean;
17   // icon on tab
18   icon?: string;
aafbb0 19
V 20   frameSrc?: string;
2f6253 21
22   // current page transition
23   transitionName?: string;
24
25   // Whether the route has been dynamically added
26   hideBreadcrumb?: boolean;
27
b8353f 28   // Carrying parameters
V 29   carryParam?: boolean;
c303ec 30
7bae4c 31   // Used internally to mark single-level menus
c303ec 32   single?: boolean;
2f6253 33 }
34
b6e5c3 35 // @ts-ignore
2f6253 36 export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
fc4666 37   name: string;
2f6253 38   meta: RouteMeta;
c303ec 39   component?: Component;
V 40   components?: Component;
2f6253 41   children?: AppRouteRecordRaw[];
c303ec 42   props?: Record<string, any>;
31e271 43   fullPath?: string;
2f6253 44 }
a3887f 45 export interface MenuTag {
V 46   type?: 'primary' | 'error' | 'warn' | 'success';
47   content?: string;
48   dot?: boolean;
49 }
2f6253 50
51 export interface Menu {
52   name: string;
53
54   icon?: string;
55
56   path: string;
57
58   disabled?: boolean;
59
60   children?: Menu[];
61
62   orderNo?: number;
63
64   roles?: RoleEnum[];
65
66   meta?: Partial<RouteMeta>;
a3887f 67
V 68   tag?: MenuTag;
2f6253 69 }
f7aa93 70
2f6253 71 export interface MenuModule {
72   orderNo?: number;
73   menu: Menu;
74 }
75
c303ec 76 // interface RouteModule {
V 77 //   layout: AppRouteRecordRaw;
78 //   routes: AppRouteRecordRaw[];
79 //   children?: AppRouteRecordRaw[];
80 //   component?: Component;
81 // }
ecfb70 82
c303ec 83 // export type AppRouteModule = RouteModule | AppRouteRecordRaw;
V 84 export type AppRouteModule = AppRouteRecordRaw;