This commit is contained in:
kailong321200875
2023-08-26 07:32:24 +08:00
parent 2095caaa85
commit b6ee4e5d48
9 changed files with 31 additions and 34 deletions

34
types/router.d.ts vendored
View File

@@ -32,21 +32,23 @@ import { defineComponent } from 'vue'
permission: ['edit','add', 'delete'] 设置该路由的权限
}
**/
interface RouteMetaCustom extends Record<string | number | symbol, unknown> {
hidden?: boolean
alwaysShow?: boolean
title?: string
icon?: string
noCache?: boolean
breadcrumb?: boolean
affix?: boolean
activeMenu?: string
noTagsView?: boolean
canTo?: boolean
permission?: string[]
}
declare module 'vue-router' {
interface RouteMeta extends Record<string | number | symbol, unknown> {
hidden?: boolean
alwaysShow?: boolean
title?: string
icon?: string
noCache?: boolean
breadcrumb?: boolean
affix?: boolean
activeMenu?: string
noTagsView?: boolean
followAuth?: string
canTo?: boolean
permission?: string[]
}
interface RouteMeta extends RouteMetaCustom {}
}
type Component<T = any> =
@@ -57,7 +59,7 @@ type Component<T = any> =
declare global {
declare interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string
meta: RouteMeta
meta: RouteMetaCustom
component?: Component | string
children?: AppRouteRecordRaw[]
props?: Recordable
@@ -66,7 +68,7 @@ declare global {
declare interface AppCustomRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string
meta: RouteMeta
meta: RouteMetaCustom
component: string
path: string
redirect: string