2025-11-11 09:54:39 +08:00

62 lines
1.7 KiB
TypeScript

import type {
RouteRecordRaw,
RouteMeta
} from 'vue-router'
import type { defineComponent } from 'vue'
export type Component<T = any> = ReturnType<typeof defineComponent> | (() => Promise<typeof import('*.vue')>) | (() => Promise<T>)
// @ts-expect-error
export interface AppRouter extends Omit<RouteRecordRaw, 'meta'> {
keepAlive?: boolean
visible?: boolean
icon?: string
name?: string
key?: string
sort?: number
parent?: AppRouter | null
parentId?: number | string
menuId?: number | string
meta: RouteMeta
component?: Component | string
components?: Component
componentName?: string
children?: AppRouter[]
props?: Recordable,
path?: string,
fullPath?: string,
hidden?: boolean,
type?: string | null,
typeName?: string | null,
menuName?: string | null
menuType?: string | null
}
// export interface AppRouter {
// keepAlive?: boolean, // 缓存
// component?: RawRouteComponent | string | null | undefined | any, // 组件
// children?: AppRouter[], // 子路由
// path?: string, // 路径
// redirect?: string, // 重定向
// isFrame?: number, // 外链
// target?: string // 外链打开方式 新标签打开还是当前页面打开
// key?: string,
// hidden: boolean, // 是否隐藏
// title?: string // 标题
// // visible?: boolean //
// // icon?: string // 图标
// name: string // 路由name
// sort?: number // 排序
// parentId?: number // 父节点
// // component?: Component | string
// // components?: Component
// // componentName?: string //
// hideChildrenInMenu?: boolean, // 隐藏下级节点
// meta?: RouteMeta, // 信息
// // props?: Recordable
// // fullPath?: string // 全路径
// }