Awesome Open Source
Awesome Open Source

背景

运行前端项目

技术栈:react,redux,router4,ant-design

npm i
yarn start

运行后端项目

技术栈:koa2 passport koa-validator koa-log4 mongodb

// 记得要安装mongodb(可参考):http://www.runoob.com/mongodb/mongodb-tutorial.html
cd server
npm i
npm start

前端 react 记录学习部分

创建项目

create-react-app

暴露内建配置

git add .
git git commit -am "Save before ejecting"
yarn run eject

该项目引用了 ant design ant-design 官网 web

小技巧

  • js 跳转路由
import createHistory from 'history/createBrowserHistory';
createHistory ().push (value.key);

利用 js 方法进行路由跳转:路由教程https://segmentfault.com/a/1190000011137828

withRouter高阶组件,提供了history让你使用~
this.props.history.push("/some/Path");
// 在需要用到的页面引入withRouter
export default withRouter(MyComponent);
  • 引入富文本编辑器 react-quill
"quill-image-drop-module": "^1.0.3",
"react-quill": "^1.1.0",

image.png image.png


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,512,666
Mongodb (14,149
React Redux (2,211
Koa2 (901
Ant Design (883
Passport (738
Related Projects