mirror of https://gitee.com/answerdev/answer.git
Revert "Fix RouteNode type error"
This commit is contained in:
parent
ffb2b6ddc8
commit
53501a3692
|
@ -2,10 +2,9 @@ import React, { Suspense, lazy } from 'react';
|
|||
import { RouteObject, createBrowserRouter } from 'react-router-dom';
|
||||
|
||||
import Layout from '@answer/pages/Layout';
|
||||
import routeConfig from '@/router/route-config';
|
||||
|
||||
import routeConfig, { RouteNode } from '@/router/route-config';
|
||||
import RouteRules from '@/router/route-rules';
|
||||
import { RouteNode } from '@/router/types';
|
||||
|
||||
const routes: RouteObject[] = [];
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
import { RouteNode } from '@/router/types';
|
||||
import { RouteObject } from 'react-router-dom';
|
||||
|
||||
export interface RouteNode extends RouteObject {
|
||||
page: string;
|
||||
children?: RouteNode[];
|
||||
rules?: string[];
|
||||
}
|
||||
const routeConfig: RouteNode[] = [
|
||||
{
|
||||
path: '/',
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
import { IndexRouteObject, NonIndexRouteObject } from 'react-router-dom';
|
||||
|
||||
type CustomRouteObject = {
|
||||
page: string;
|
||||
rules?: string[];
|
||||
};
|
||||
|
||||
type IndexRouteNode = IndexRouteObject & CustomRouteObject;
|
||||
|
||||
interface NonIndexRouteNode extends NonIndexRouteObject, CustomRouteObject {
|
||||
children?: (IndexRouteNode | NonIndexRouteNode)[];
|
||||
}
|
||||
|
||||
export type RouteNode = IndexRouteNode | NonIndexRouteNode;
|
Loading…
Reference in New Issue