-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(projects): 重构路由类型和路由元数据类型,重构多级菜单路由写法
- Loading branch information
1 parent
9fb641f
commit d683894
Showing
20 changed files
with
144 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import BasicLayout from './BasicLayout/index.vue'; | ||
import BlankLayout from './BlankLayout/index.vue'; | ||
import RouterViewLayout from './RouterViewLayout/index.vue'; | ||
|
||
export { BasicLayout, BlankLayout, RouterViewLayout }; | ||
export { BasicLayout, BlankLayout }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import type { RouteRecordRaw } from 'vue-router'; | ||
import { transformMultiDegreeRoutes } from '@/utils'; | ||
import customRoutes from '../modules'; | ||
import constantRoutes from './constant-routes'; | ||
|
||
const transformRoutes = transformMultiDegreeRoutes(customRoutes); | ||
|
||
/** 所有路由 */ | ||
export const routes: RouteRecordRaw[] = [...customRoutes, ...constantRoutes]; | ||
export const routes: RouteRecordRaw[] = [...transformRoutes, ...constantRoutes]; | ||
|
||
export { ROUTE_HOME } from './route-home'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.