You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

66 lines
1.5 KiB

import type { RouteMeta, RouteRecordRaw } from 'vue-router'
import type { Component as VueComponent, defineComponent } from 'vue'
import type { RoleEnum } from '@/enums/roleEnum'
2 years ago
export type Component<T = any> = ReturnType<typeof defineComponent> | (() => Promise<VueComponent>) | (() => Promise<T>)
2 years ago
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta' | 'children'> {
keepAlive?: boolean
visible?: boolean
icon?: string
2 years ago
name: string
2 years ago
sort?: number
parentId?: string
2 years ago
meta: RouteMeta
component?: Component | string
components?: Component
2 years ago
componentName?: string
2 years ago
children?: AppRouteRecordRaw[]
props?: Recordable
fullPath?: string
}
export interface MenuTag {
// 类型
2 years ago
type?: 'primary' | 'error' | 'warn' | 'success'
// 内容
2 years ago
content?: string
// 为true则显示小圆点
2 years ago
dot?: boolean
}
export interface Menu {
// 菜单名
2 years ago
name: string
// 菜单图标,如果没有,则会尝试使用route.meta.icon
2 years ago
icon?: string
img?: string
// 菜单路径
2 years ago
path: string
// path contains param, auto assignment.
paramPath?: string
// 是否禁用
2 years ago
disabled?: boolean
// 子菜单
2 years ago
children?: Menu[]
// 菜单排序
2 years ago
orderNo?: number
roles?: RoleEnum[]
meta?: Partial<RouteMeta>
// 菜单标签设置
2 years ago
tag?: MenuTag
// 是否隐藏菜单
2 years ago
hideMenu?: boolean
}
export interface MenuModule {
orderNo?: number
menu: Menu
}
// export type AppRouteModule = RouteModule | AppRouteRecordRaw;
export type AppRouteModule = AppRouteRecordRaw