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.
60 lines
1.1 KiB
TypeScript
60 lines
1.1 KiB
TypeScript
import type { RouteRecordRaw, RouteMeta } from 'vue-router'
|
|
import { RoleEnum } from '/@/enums/roleEnum'
|
|
import { defineComponent } from 'vue'
|
|
|
|
export type Component<T = any> =
|
|
| ReturnType<typeof defineComponent>
|
|
| (() => Promise<typeof import('*.vue')>)
|
|
| (() => Promise<T>)
|
|
|
|
// @ts-ignore
|
|
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
|
|
name: string
|
|
meta: RouteMeta
|
|
component?: Component | string
|
|
components?: Component
|
|
children?: AppRouteRecordRaw[]
|
|
props?: Recordable
|
|
fullPath?: string
|
|
tag?: MenuTag
|
|
}
|
|
|
|
export interface MenuTag {
|
|
type?: 'primary' | 'error' | 'warn' | 'success'
|
|
content?: string
|
|
dot?: boolean
|
|
}
|
|
|
|
export interface Menu {
|
|
name: string
|
|
|
|
icon?: string
|
|
|
|
path: string
|
|
|
|
// path contains param, auto assignment.
|
|
paramPath?: string
|
|
|
|
disabled?: boolean
|
|
|
|
children?: Menu[]
|
|
|
|
orderNo?: number
|
|
|
|
roles?: RoleEnum[]
|
|
|
|
meta?: Partial<RouteMeta>
|
|
|
|
tag?: MenuTag
|
|
|
|
hideMenu?: boolean
|
|
}
|
|
|
|
export interface MenuModule {
|
|
orderNo?: number
|
|
menu: Menu
|
|
}
|
|
|
|
// export type AppRouteModule = RouteModule | AppRouteRecordRaw;
|
|
export type AppRouteModule = AppRouteRecordRaw
|