optimize ts type

This commit is contained in:
xiaoma
2021-09-24 09:08:23 +08:00
parent 7929a74d20
commit ef4912636e
13 changed files with 490 additions and 373 deletions

View File

@@ -4,7 +4,6 @@ import { RedirectRoute } from '@/router/base';
import { PageEnum } from '@/enums/pageEnum';
import { createRouterGuards } from './router-guards';
// @ts-ignore
const modules = import.meta.globEager('./modules/**/*.ts');
const routeModuleList: RouteRecordRaw[] = [];

View File

@@ -6,7 +6,6 @@ export type Component<T extends any = any> =
| (() => Promise<typeof import('*.vue')>)
| (() => Promise<T>);
// @ts-ignore
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string;
meta: RouteMeta;
@@ -33,4 +32,24 @@ export interface Meta {
frameSrc?: string;
// 外链跳转地址
externalLink?: string;
//隐藏
hidden?: boolean;
}
export interface Menu {
title: string;
label: string;
key: string;
meta: RouteMeta;
name: string;
component?: Component | string;
components?: Component;
children?: AppRouteRecordRaw[];
props?: Recordable;
fullPath?: string;
icon?: any;
path: string;
permissions?: string[];
redirect?: string;
sort?: number;
}