fix:解决拖拽问题
This commit is contained in:
1 parent
ce06ad0214
commit
6367014e1f
34 files changed
+1712
-397
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import { createBrowserRouter, Navigate } from "react-router-dom";
|
||||
import Home from "@/pages/Home";
|
||||
import Experiment from "../pages/experiment";
|
||||
import NotFound from "../pages/NotFound";
|
||||
|
||||
/**
|
||||
* 应用路由配置
|
||||
* 使用 React Router v7 的 createBrowserRouter
|
||||
*/
|
||||
const router = createBrowserRouter([
|
||||
// {
|
||||
// path: '/',
|
||||
// element: <Layout />,
|
||||
// errorElement: <NotFound />,
|
||||
// children: [
|
||||
// {
|
||||
// index: true,
|
||||
// element: <Home />,
|
||||
// },
|
||||
// {
|
||||
// path: 'experiment/:id',
|
||||
// element: <ExperimentDetail />,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: "/",
|
||||
element: <Navigate to="/home" replace />,
|
||||
//重定向
|
||||
},
|
||||
{
|
||||
path: "/home",
|
||||
element: <Home />,
|
||||
},
|
||||
{
|
||||
path: "/experiment",
|
||||
element: <Experiment />,
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
element: <NotFound />,
|
||||
},
|
||||
]);
|
||||
|
||||
export default router;
|
||||
Reference in new issue
Block a user