feat:init
This commit is contained in:
1 parent
53d0eeac6b
commit
ae0c050010
494 files changed
+17701
-2318
No files matched your search
+35
-21
@@ -1,40 +1,54 @@
|
||||
import { createHashRouter, Navigate } from "react-router-dom";
|
||||
import { createHashRouter, Navigate, RouteObject } from "react-router-dom";
|
||||
|
||||
import Home from "@/pages/Home";
|
||||
import Menu from "@/pages/Menu";
|
||||
import NotFound from "@/pages/NotFound";
|
||||
import Publicity from "@/pages/Publicity";
|
||||
import Content from "@/pages/Content";
|
||||
import Guide from "@/pages/Guide";
|
||||
/**
|
||||
* 应用路由配置
|
||||
* 使用 React Router v7 的 createHashRouter
|
||||
*/
|
||||
const router = createHashRouter([
|
||||
import Menu from "@/pages/Menu";
|
||||
import Entrance from "@/pages/entrance";
|
||||
|
||||
//各个故居路由
|
||||
import { ChenyunRoutes, MaozedongRoutes, SunzhongshanRoutes, HuangyanpeiRoutes, LuxunRoutes } from "./modules";
|
||||
|
||||
const baseRoutes: RouteObject[] = [
|
||||
{
|
||||
path: "/",
|
||||
element: <Navigate to="/home" replace />,
|
||||
//重定向
|
||||
},
|
||||
{
|
||||
path: "/home",
|
||||
element: <Home />,
|
||||
},
|
||||
/**
|
||||
* 沪上故居-分为四个类型-8个故居
|
||||
* 类型:1:革命先驱、文化名人、艺术名家、经济巨擘
|
||||
* 每个类型下有2个故居
|
||||
* 革命先驱:毛泽东、孙中山
|
||||
* 文化名人:鲁迅、黄炎培
|
||||
* 艺术名家:聂耳、刘海栗
|
||||
* 经济巨擘:荣德生、陈云
|
||||
*/
|
||||
{
|
||||
path: "/menu",
|
||||
element: <Menu />,
|
||||
},
|
||||
{
|
||||
path: "/guide",
|
||||
element: <Guide />,
|
||||
},
|
||||
{
|
||||
path: "/publicity",
|
||||
element: <Publicity />,
|
||||
},
|
||||
{
|
||||
path: "/content/:id",
|
||||
element: <Content />,
|
||||
path: "/entrance/:moduleName",
|
||||
element: <Entrance />,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 应用路由配置
|
||||
* 使用 React Router v7 的 createHashRouter
|
||||
*/
|
||||
const router = createHashRouter([
|
||||
//基础路由
|
||||
...baseRoutes,
|
||||
//名人故居
|
||||
...ChenyunRoutes,
|
||||
...MaozedongRoutes,
|
||||
...SunzhongshanRoutes,
|
||||
...HuangyanpeiRoutes,
|
||||
...LuxunRoutes,
|
||||
{
|
||||
path: "*",
|
||||
element: <NotFound />,
|
||||
|
||||
Reference in new issue
Block a user