feat: 添加路由树统一数据源,新增 antd/icons 依赖
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
import { createBrowserRouter } from 'react-router';
|
||||
import RootLayout from './layouts/RootLayout';
|
||||
import About from './pages/About';
|
||||
import Home from './pages/Home';
|
||||
import NotFound from './pages/NotFound';
|
||||
import { routes } from './routes';
|
||||
import { toRouteObjects } from './routes/utils';
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: '/',
|
||||
element: <RootLayout />,
|
||||
children: [
|
||||
{ index: true, element: <Home /> },
|
||||
{ path: 'about', element: <About /> },
|
||||
{ path: '*', element: <NotFound /> },
|
||||
],
|
||||
children: toRouteObjects(routes),
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user