- App.js ```javascript import React from ‘react’; import ‘./App.css’;
class App extends React.Component { constructor(props) { super(props); this.state = { id: 1, list: [] } } render() { return (
ToDoList
正在进行 {this.uncomplete()}
{this.state.list.map(item => { return ({item.name}
已经完成 {this.complete()}
{this.state.list.map(item => { return ({item.name}
Copyright © 2019 todolist.cn
} export default App;
- App.css```css*{margin: 0;padding: 0;}body{background: #CDCDCD}.logo {color: #fff;font-size: 24px;}.nav {background: #323232;height: 50px;}.nav-row {width: 600px;margin: 0 auto;display: flex;align-items: center;height: 50px;justify-content: space-between;}.nav input {height: 23px;width: 350px;border-radius: 5px;box-shadow: 0 1px 0 rgba(255, 255, 255, 0.24),0 1px 6px rgba(0, 0, 0, 0.45) inset;border: none;padding-left: 10px;outline: none;}.content {width: 600px;margin: 0 auto;}.content-nav {display: flex;justify-content: space-between;font-size: 25px;font-weight: bold;margin: 20px 0;align-items: center;}.content-nav span {font-size: 14px;width: 20px;height: 20px;background: rgb(238, 236, 236);border-radius: 10px;text-align: center;line-height: 20px;}.iconfont {color: #cccccc;cursor: pointer;}.list {background: #fff;display: flex;justify-content: space-around;height: 32px;align-items: center;border-radius: 5px;border-left: 5px solid #629a9c;margin-bottom: 10px;}.content input {width: 22px;height: 22px;cursor: pointer;}.text {width: 505px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}.foot {text-align: center;color: #666;}.list-complete {opacity: 0.3;border-left: 5px solid #666;}
