You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.8 KiB
TypeScript

5 months ago
import type { RouteRecordRaw } from 'vue-router'
import { defineComponent } from 'vue'
/**
* redirect: noredirect noredirect
* name:'router-name' 使<keep-alive>
* meta : {
hidden: true true 404login( false)
alwaysShow: true children 1
children
alwaysShow: true
( false)
title: 'title'
icon: 'svg-name'
noCache: true true <keep-alive> ( false)
breadcrumb: false falsebreadcrumb( true)
affix: true truetag( false)
noTagsView: true truetag( false)
activeMenu: '/home'
followAuth: '/home'
canTo: true true使hiddentrue( false)
}
**/
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
}
}
type Component<T = any> =
| ReturnType<typeof defineComponent>
| (() => Promise<typeof import('*.vue')>)
| (() => Promise<T>)
declare global {
interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string
meta: RouteMeta
component?: Component | string
children?: AppRouteRecordRaw[]
props?: Recordable
fullPath?: string
keepAlive?: boolean
}
interface AppCustomRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
icon: any
name: string
meta: RouteMeta
component: string
componentName?: string
path: string
redirect: string
children?: AppCustomRouteRecordRaw[]
keepAlive?: boolean
visible?: boolean
parentId?: number
alwaysShow?: boolean
}
}