File tree 4 files changed +31
-28
lines changed
4 files changed +31
-28
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export default {
6
6
[
7
7
'umi-plugin-react' ,
8
8
{
9
- antd : false ,
9
+ antd : true ,
10
10
dva : true ,
11
11
dynamicImport : false ,
12
12
title : 'umi' ,
Original file line number Diff line number Diff line change 4
4
"start" : " umi dev" ,
5
5
"build" : " umi build" ,
6
6
"test" : " umi test" ,
7
-
8
7
"lint" : " eslint --ext .js src mock tests" ,
9
-
10
-
11
8
"precommit" : " lint-staged"
12
9
},
13
10
"dependencies" : {
14
-
15
11
"dva" : " ^2.5.0-beta.2" ,
16
-
17
-
18
12
"react" : " ^16.7.0" ,
19
13
"react-dom" : " ^16.7.0"
20
14
},
21
15
"devDependencies" : {
22
-
23
16
"babel-eslint" : " ^9.0.0" ,
24
17
"eslint" : " ^5.4.0" ,
25
18
"eslint-config-umi" : " ^1.4.0" ,
30
23
"husky" : " ^0.14.3" ,
31
24
"lint-staged" : " ^7.2.2" ,
32
25
"react-test-renderer" : " ^16.7.0" ,
33
-
34
26
"umi" : " ^2.6.3" ,
35
27
"umi-plugin-react" : " ^1.6.0"
36
-
37
- },
28
+ },
38
29
"lint-staged" : {
39
-
40
- "*.{js,jsx}" : [" eslint --fix" , " git add" ]
30
+ "*.{js,jsx}" : [
31
+ " eslint --fix" ,
32
+ " git add"
33
+ ]
41
34
},
42
35
"engines" : {
43
36
"node" : " >=8.0.0"
Original file line number Diff line number Diff line change 1
- import styles from './index.css' ;
1
+ import { Menu , Icon } from 'antd' ;
2
+ import Link from 'umi/link' ;
3
+ import withRouter from 'umi/withRouter' ;
2
4
3
- function BasicLayout ( props ) {
5
+ function layout ( { children , location } ) {
4
6
return (
5
- < div className = { styles . normal } >
6
- < h1 className = { styles . title } > Another day, Another dollor.</ h1 >
7
- < ul className = { styles . nav } >
8
- < li >
9
- < a href = "/" > index</ a >
10
- </ li >
11
- < li >
12
- < a href = "/todos" > Todos</ a >
13
- </ li >
14
- </ ul >
15
- { props . children }
7
+ < div >
8
+ < Menu selectedKeys = { [ location . pathname ] } mode = "horizontal" theme = "dark" >
9
+ < Menu . Item key = "/" >
10
+ < Link to = "/" >
11
+ < Icon type = "home" />
12
+ Home
13
+ </ Link >
14
+ </ Menu . Item >
15
+
16
+ < Menu . Item key = "/todos" >
17
+ < Link to = "/todos" >
18
+ < Icon type = "bars" />
19
+ Todos
20
+ </ Link >
21
+ </ Menu . Item >
22
+ </ Menu >
23
+ { children }
16
24
</ div >
17
25
) ;
18
26
}
19
27
20
- export default BasicLayout ;
28
+ export default withRouter ( layout ) ;
Original file line number Diff line number Diff line change 26
26
.todoClose {
27
27
float : right;
28
28
border-radius : 50% ;
29
- margin-left : 1rem ;
29
+ font-size : 1px ;
30
+ border : none;
31
+ background-color : grey;
30
32
}
31
33
32
34
.todoInsert {
You can’t perform that action at this time.
0 commit comments