目标
用react实现一个todolist。
开始
初始化项目
1 | npx create-react-app my-app |
想用sass写样式,所以要配置下sass-loader,我当前版本react版本已经支持sass了,但还要装一下node-sass。1
npm install node-sass -D
页面框架用Antd。1
npm install antd --save
项目构建
1 | // index.js |
1 | // App.js |
1 | /* App.css */ |
1 | // pages/Index/index.js |
1 | // pages/Index/components/ListItem.js |
1 | // utils/common.js |