feat(projects): add custom route exception

This commit is contained in:
Soybean
2024-01-19 01:24:45 +08:00
parent 4955f1af89
commit b43c925696
8 changed files with 86 additions and 31 deletions

View File

@ -17,6 +17,10 @@ declare module "@elegant-router/types" {
export type RouteMap = {
"root": "/";
"not-found": "/:pathMatch(.*)*";
"exception": "/exception";
"exception_403": "/exception/403";
"exception_404": "/exception/404";
"exception_500": "/exception/500";
"403": "/403";
"404": "/404";
"500": "/500";
@ -54,6 +58,10 @@ declare module "@elegant-router/types" {
RouteKey,
| "root"
| "not-found"
| "exception"
| "exception_403"
| "exception_404"
| "exception_500"
>;
/**
@ -84,6 +92,7 @@ declare module "@elegant-router/types" {
CustomRouteKey,
| "root"
| "not-found"
| "exception"
>;
/**
@ -113,6 +122,9 @@ declare module "@elegant-router/types" {
CustomRouteKey,
| "root"
| "not-found"
| "exception_403"
| "exception_404"
| "exception_500"
>;
/**
@ -241,7 +253,7 @@ declare module "@elegant-router/types" {
name: K;
path: RouteMap[K];
component: `layout.${RouteLayout}`;
children: (CustomCenterLevelRoute<GetChildRouteKey<K>> | CustomLastLevelRoute<K>)[];
children: (CustomCenterLevelRoute<GetChildRouteKey<K>> | CustomLastLevelRoute<GetChildRouteKey<K>>)[];
}
: never;