Open chunhuile opened 4 months ago
函数式写法 import React from "react"; import { RouteObject,Navigate } from "react-router-dom"; import Login from "../pages/Login"
import Home from "../pages/Dashboard/index"; import UserManagement from "../pages/UserManagement"; import Dashboard from "../pages/Dashboard/dashboard" import ProductManagement from "../pages/ProductManagement";
const withLoadingComponent = (comp:JSX.Element) => { <React.Suspense fallback={
// react router v6·路由配置 (路由表)
const rootRouter :RouteObject[]=[
{
path: "/",
element:
{
path:"/login",
element:
] export default rootRouter;
react的路由配置有通过link实现 也可以通过函数式写法实现