From fa3ac93010bea3805438ee3ab0a182bfbf7423da Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期一, 27 五月 2024 16:19:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/router/types.ts | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/src/router/types.ts b/src/router/types.ts new file mode 100644 index 0000000..f94f7d9 --- /dev/null +++ b/src/router/types.ts @@ -0,0 +1,58 @@ +import { defineComponent } from 'vue' +import type { RouteMeta, RouteRecordRaw } from 'vue-router' +import { RoleEnum } from '/@/enums/roleEnum' + +export type Component<T extends any = 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 + alwaysShow?: boolean +} + +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 + + alwaysShow?: boolean +} + +export interface MenuModule { + orderNo?: number + menu: Menu +} + +// export type AppRouteModule = RouteModule | AppRouteRecordRaw; +export type AppRouteModule = AppRouteRecordRaw -- Gitblit v1.9.3