fix: 修复 RouteMeta 字段不完整的问题

This commit is contained in:
pany
2022-08-23 18:09:13 +08:00
parent a9f8e6ccc2
commit f1c8a14b98
5 changed files with 46 additions and 36 deletions

41
types/vue-router.d.ts vendored Normal file
View File

@@ -0,0 +1,41 @@
import 'vue-router'
declare module "vue-router" {
interface RouteMeta {
/**
* 设置该路由在侧边栏和面包屑中展示的名字
*/
title?: string
/**
* 设置该路由的图标,记得将 svg 导入 @/icons/svg
*/
icon?: string
/**
* 默认 false设置 true 的时候该路由不会在侧边栏出现
*/
hidden?: boolean
/**
* 设置该路由进入的权限,支持多个权限叠加
*/
roles?: string[]
/**
* 默认 true如果设置为 false则不会在面包屑中显示
*/
breadcrumb?: boolean
/**
* 默认 false如果设置为 true它则会固定在 tags-view 中
*/
affix?: boolean
/**
* 当一个路由下面的 children 声明的路由大于 1 个时,自动会变成嵌套的模式
* 只有一个时,会将那个子路由当做根路由显示在侧边栏
* 若想不管路由下面的 children 声明的个数都显示你的根路由
* 可以设置 alwaysShow: true这样就会忽略之前定义的规则一直显示根路由
*/
alwaysShow?: boolean
/**
* 当设置了该属性,进入路由时,则会高亮 activeMenu 属性对应的侧边栏
*/
activeMenu?: string
}
}