Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 10:59:21 +08:00
v3-admin-vite/types/vue-router.d.ts
2024-12-02 17:07:21 +08:00

58 lines
2.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type * as ElementPlusIconsVue from "@element-plus/icons-vue"
import type { SvgName } from "~virtual/svg-component"
import "vue-router"
export {}
type ElementPlusIconsName = keyof typeof ElementPlusIconsVue
declare module "vue-router" {
interface RouteMeta {
/**
* @description 设置该路由在侧边栏和面包屑中展示的名字
*/
title?: string
/**
* @description 设置该路由的图标,记得将 svg 导入 src/common/assets/icons
*/
svgIcon?: SvgName
/**
* @description 设置该路由的图标,直接使用 Element Plus 的 Icon与 svgIcon 同时设置时svgIcon 将优先生效)
*/
elIcon?: ElementPlusIconsName
/**
* @description 默认 false设置 true 的时候该路由不会在侧边栏出现
*/
hidden?: boolean
/**
* @description 设置能进入该路由的角色,支持多个角色叠加
*/
roles?: string[]
/**
* @description 默认 true如果设置为 false则不会在面包屑中显示
*/
breadcrumb?: boolean
/**
* @description 默认 false如果设置为 true它则会固定在 tags-view 中
*/
affix?: boolean
/**
* @description 当一个路由的 children 属性中声明的非隐藏子路由只有 1 个且该子路由为叶子节点时,会将这个子路由当做父路由显示在侧边栏
* @description 当大于 1 个时,会恢复成嵌套模式
* @description 如果想不管个数总是显示父路由,可以在父路由上设置 alwaysShow: true
*/
alwaysShow?: boolean
/**
* @description 示例: activeMenu: "/xxx/xxx"
* @description 当设置了该属性进入路由时,则会高亮 activeMenu 属性对应的侧边栏
* @description 该属性适合使用在有 hidden: true 属性的路由上
*/
activeMenu?: string
/**
* @description 是否缓存该路由页面
* @description 默认为 false为 true 时代表需要缓存,此时该路由和该页面都需要设置一致的 Name
*/
keepAlive?: boolean
}
}