import React from 'react'
import { useRoutes } from 'react-router-dom'
import LazyLoad from '../component/LazyLoad'
import Redirect from '../component/Redirect'
import AuthComponent from '../component/AuthComponent'
export default function ComStemRouter() {
const element = useRoutes([
{
path: '/home', element:<AuthComponent> {LazyLoad({ path: "Home" })}</AuthComponent>, children: [
{
path: 'index', element: LazyLoad({ path: 'index/Index' })
},
{
path: 'feed', element: LazyLoad({ path: 'feed/Feed' })
},
{
path: 'mine', element: LazyLoad({ path: 'mine/Mine' })
},
{
path: '', element: <Redirect to="/home/index"></Redirect>
}
]
},
{
path: '/detail', element: LazyLoad({ path: "feed/FeedDetail" })
},
{
path: '/login', element: LazyLoad({ path: "Login" })
},
{
path: '/', element: <Redirect to="/home"></Redirect>
},
{
path: '*', element: <div>404</div>
}
])
return element
}
没有合适的资源?快使用搜索试试~ 我知道了~
React-router6
共21个文件
js:16个
css:4个
svg:1个
需积分: 6 0 下载量 178 浏览量
2022-11-23
10:34:27
上传
评论
收藏 7KB RAR 举报
温馨提示
React-router6
资源推荐
资源详情
资源评论
收起资源包目录
src.rar (21个子文件)
src
css
articletoobar.css 391B
toobar.css 356B
toobar
HomeToobar.js 583B
App.css 564B
index.js 628B
reportWebVitals.js 362B
component
LazyLoad.js 306B
Redirect.js 309B
AuthComponent.js 223B
page
index
Index.js 106B
Home.js 256B
feed
FeedDetail.js 341B
Feed.js 403B
mine
Mine.js 104B
Login.js 435B
logo.svg 3KB
App.test.js 246B
setupTests.js 241B
App.js 242B
router
ComStemRouter.js 1KB
index.css 366B
共 21 条
- 1
资源评论
平谷一勺
- 粉丝: 851
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功