types.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. // current page transition
  21. transitionName?: string;
  22. // Whether the route has been dynamically added
  23. hideBreadcrumb?: boolean;
  24. // disabled redirect
  25. disabledRedirect?: boolean;
  26. // close loading
  27. afterCloseLoading?: boolean;
  28. // Is it in the tab
  29. inTab?: boolean;
  30. // Carrying parameters
  31. carryParam?: boolean;
  32. }
  33. export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
  34. meta: RouteMeta;
  35. component?: any;
  36. components?: any;
  37. children?: AppRouteRecordRaw[];
  38. props?: any;
  39. fullPath?: string;
  40. }
  41. export interface Menu {
  42. name: string;
  43. icon?: string;
  44. path: string;
  45. disabled?: boolean;
  46. children?: Menu[];
  47. orderNo?: number;
  48. roles?: RoleEnum[];
  49. meta?: Partial<RouteMeta>;
  50. }
  51. export interface MenuModule {
  52. orderNo?: number;
  53. menu: Menu;
  54. }
  55. export interface AppRouteModule {
  56. layout: AppRouteRecordRaw;
  57. routes: AppRouteRecordRaw[];
  58. }