- 安装node环境,本项目
node版本v10.15.3
- 安装依赖
npm install
- 运行
npm start
Node:
运行项目之前,需先启动blog-koa项目
"dependencies": {
"@types/jest": "24.0.23",
"@types/node": "12.12.11",
"@types/react": "16.9.11",
"@types/react-custom-scrollbars": "^4.0.6",
"@types/react-dom": "16.9.4",
"antd": "^3.25.2",
"axios": "^0.19.0",
"highlight.js": "^9.17.1",
"marked": "^0.8.0",
"react": "^16.12.0",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^16.12.0",
"react-infinite-scroller": "^1.2.4",
"react-loadable": "^5.5.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"redux": "^4.0.4",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"store": "^2.0.12",
"typescript": "3.7.2"
}
HomeRouters.js
//项目路由目录,整个项目的页面路由
-SimpleCode:
const routerList: any[] = [
{
component: () => import('../pages/Home'),
path: '/'
},
{
component: () => import('../pages/Directory'),
path: '/directory'
},
{
component: () => import('../pages/Project'),
path: '/project'
},
{
component: () => import('../pages/About'),
path: '/about'
},
{
component: () => import('../pages/NotFound'),
path: '/notfound'
}
]