Commit d5f3bb0 1 parent 645c050 commit d5f3bb0 Copy full SHA for d5f3bb0
File tree 1 file changed +19
-7
lines changed
1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,28 @@ import logo from './logo.svg';
3
3
import './App.css' ;
4
4
5
5
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
+
6
17
render ( ) {
18
+ let todos = this . state . todoList . map ( ( item , index ) => {
19
+ return < li > { item . title } </ li > ;
20
+ } ) ;
21
+
7
22
return (
8
23
< 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 >
16
28
</ div >
17
29
) ;
18
30
}
You can’t perform that action at this time.
0 commit comments