Skip to content

Commit d5f3bb0

Browse files
committed
Complete the basic framework
1 parent 645c050 commit d5f3bb0

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

src/App.js

+19-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@ import logo from './logo.svg';
33
import './App.css';
44

55
class App extends Component {
6+
constructor(props) {
7+
super(props);
8+
this.state = {
9+
newTodo: 'test',
10+
todoList: [{
11+
id: 1,
12+
title: 'hello world'
13+
}]
14+
};
15+
}
16+
617
render() {
18+
let todos = this.state.todoList.map((item, index) => {
19+
return <li>{item.title}</li>;
20+
});
21+
722
return (
823
<div className="App">
9-
<header className="App-header">
10-
<img src={logo} className="App-logo" alt="logo" />
11-
<h1 className="App-title">Welcome to React</h1>
12-
</header>
13-
<p className="App-intro">
14-
To get started, edit <code>src/App.js</code> and save to reload.
15-
</p>
24+
<h1>我的待办</h1>
25+
<div className="inputWrapper">
26+
<input type="text" value={this.state.newTodo} />
27+
</div>
1628
</div>
1729
);
1830
}

0 commit comments

Comments
 (0)