gtsoft-snail-job-admin/src/typings/router.d.ts

71 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-03-08 17:59:45 +08:00
import 'vue-router';
declare module 'vue-router' {
interface RouteMeta {
/**
* Title of the route
*
* It can be used in document title
*/
title: string;
/**
* I18n key of the route
*
* It's used in i18n, if it is set, the title will be ignored
*/
2024-05-08 11:57:58 +08:00
i18nKey?: App.I18n.I18nKey | null;
2024-03-08 17:59:45 +08:00
/**
* Roles of the route
*
* Route can be accessed if the current user has at least one of the roles
2024-05-08 11:57:58 +08:00
*
* It only works when the route mode is "static", if the route mode is "dynamic", it will be ignored
2024-03-08 17:59:45 +08:00
*/
roles?: string[];
/** Whether to cache the route */
2024-05-08 11:57:58 +08:00
keepAlive?: boolean | null;
2024-03-08 17:59:45 +08:00
/**
* Is constant route
*
2024-06-07 11:24:30 +08:00
* when it is set to true, there will be no login verification and no permission verification to access the route
2024-03-08 17:59:45 +08:00
*/
2024-05-08 11:57:58 +08:00
constant?: boolean | null;
2024-03-08 17:59:45 +08:00
/**
* Iconify icon
*
* It can be used in the menu or breadcrumb
*/
icon?: string;
/**
* Local icon
*
* In "src/assets/svg-icon", if it is set, the icon will be ignored
*/
localIcon?: string;
/** Router order */
2024-05-08 11:57:58 +08:00
order?: number | null;
2024-03-08 17:59:45 +08:00
/** The outer link of the route */
2024-05-08 11:57:58 +08:00
href?: string | null;
2024-03-08 17:59:45 +08:00
/** Whether to hide the route in the menu */
2024-05-08 11:57:58 +08:00
hideInMenu?: boolean | null;
2024-03-08 17:59:45 +08:00
/**
* The menu key will be activated when entering the route
*
* The route is not in the menu
*
* @example
* the route is "user_detail", if it is set to "user_list", the menu "user_list" will be activated
*/
2024-05-08 11:57:58 +08:00
activeMenu?: import('@elegant-router/types').RouteKey | null;
2024-06-07 11:24:30 +08:00
/**
* By default, the same route path will use one tab, even with different query, if set true, the route with
* different query will use different tabs
*/
2024-05-08 11:57:58 +08:00
multiTab?: boolean | null;
2024-03-08 17:59:45 +08:00
/** If set, the route will be fixed in tabs, and the value is the order of fixed tabs */
2024-04-28 14:06:34 +08:00
fixedIndexInTab?: number | null;
2024-03-21 10:57:53 +08:00
/** if set query parameters, it will be automatically carried when entering the route */
2024-05-08 11:57:58 +08:00
query?: { key: string; value: string }[] | null;
2024-03-08 17:59:45 +08:00
}
}