fix(projects): not only /login
claim dynamic path scenario , but also others , eg:/user/1
This commit is contained in:
parent
3503dff663
commit
6059891556
6
src/typings/route.d.ts
vendored
6
src/typings/route.d.ts
vendored
@ -28,11 +28,11 @@ declare namespace AuthRoute {
|
||||
type RouteComponentType = 'basic' | 'blank' | 'multi' | 'self';
|
||||
|
||||
/** 路由描述 */
|
||||
interface RouteMeta {
|
||||
interface RouteMeta<K extends AuthRoute.RoutePath> {
|
||||
/** 路由标题(可用来作document.title或者菜单的名称) */
|
||||
title: string;
|
||||
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
|
||||
dynamicPath?: AuthRouteUtils.GetDynamicPath<'/login'>;
|
||||
dynamicPath?: AuthRouteUtils.GetDynamicPath<K>;
|
||||
/** 作为单级路由的父级路由布局组件 */
|
||||
singleLayout?: Extract<RouteComponentType, 'basic' | 'blank'>;
|
||||
/** 需要登录权限 */
|
||||
@ -83,7 +83,7 @@ declare namespace AuthRoute {
|
||||
/** 子路由 */
|
||||
children?: Route[];
|
||||
/** 路由描述 */
|
||||
meta: RouteMeta;
|
||||
meta: RouteMeta<RoutePath<K>>;
|
||||
} & Omit<import('vue-router').RouteRecordRaw, 'name' | 'path' | 'redirect' | 'component' | 'children' | 'meta'>
|
||||
: never;
|
||||
|
||||
|
2
src/typings/router.d.ts
vendored
2
src/typings/router.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
import 'vue-router';
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta extends AuthRoute.RouteMeta {}
|
||||
interface RouteMeta extends AuthRoute.RouteMeta<AuthRoute.RoutePath> {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user