fix: #319
This commit is contained in:
34
types/router.d.ts
vendored
34
types/router.d.ts
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user