refactor(projects): 重构路由类型和路由元数据类型,重构多级菜单路由写法

This commit is contained in:
Soybean
2021-11-28 12:17:48 +08:00
parent 9fb641f71e
commit d683894beb
20 changed files with 144 additions and 115 deletions

22
src/typings/router.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
import 'vue-router';
declare module 'vue-router' {
interface RouteMeta {
/** 路由名称(作为菜单时为菜单的名称) */
title: string;
/** 需要登录权限 */
requiresAuth?: boolean;
/** 缓存页面 */
keepAlive?: boolean;
/** 页面占满剩余高度(去除头部、tab和底部后的高度) */
fullPage?: boolean;
/** 不作为菜单 */
notAsMenu?: boolean;
/** 菜单和面包屑对应的图标 */
icon?: string;
/** 导入的路由模块排序,可用于菜单的排序 */
order?: number;
/** y方向滚动的距离(被缓存的页面保留滚动行为) */
scrollY?: number;
}
}