Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
admin-localhome
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
localhome
admin-localhome
Commits
2c763479
Commit
2c763479
authored
Feb 22, 2018
by
chencheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6. Add layout
parent
ee9ccba3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
0 deletions
+64
-0
Header.js
src/layouts/Header.js
+30
-0
index.css
src/layouts/index.css
+15
-0
index.js
src/layouts/index.js
+19
-0
No files found.
src/layouts/Header.js
0 → 100644
View file @
2c763479
import
{
Menu
,
Icon
}
from
'antd'
;
import
Link
from
'umi/link'
;
function
Header
({
location
})
{
return
(
<
Menu
selectedKeys
=
{[
location
.
pathname
]}
mode
=
"horizontal"
theme
=
"dark"
>
<
Menu
.
Item
key
=
"/"
>
<
Link
to
=
"/"
><
Icon
type
=
"home"
/>
Home
<
/Link
>
<
/Menu.Item
>
<
Menu
.
Item
key
=
"/users"
>
<
Link
to
=
"/users"
><
Icon
type
=
"bars"
/>
Users
<
/Link
>
<
/Menu.Item
>
<
Menu
.
Item
key
=
"/umi"
>
<
a
href
=
"https://github.com/umijs/umi"
target
=
"_blank"
>
umi
<
/a
>
<
/Menu.Item
>
<
Menu
.
Item
key
=
"/dva"
>
<
a
href
=
"https://github.com/dvajs/dva"
target
=
"_blank"
>
dva
<
/a
>
<
/Menu.Item
>
<
Menu
.
Item
key
=
"/404"
>
<
Link
to
=
"/page-you-dont-know"
><
Icon
type
=
"frown-circle"
/>
404
<
/Link
>
<
/Menu.Item
>
<
/Menu
>
);
}
export
default
Header
;
src/layouts/index.css
0 → 100644
View file @
2c763479
.normal
{
display
:
flex
;
flex-direction
:
column
;
height
:
100%
;
}
.content
{
flex
:
1
;
display
:
flex
;
}
.main
{
padding
:
0
8px
;
flex
:
1
0
auto
;
}
src/layouts/index.js
0 → 100644
View file @
2c763479
import
React
from
'react'
;
import
styles
from
'./index.css'
;
import
Header
from
'./Header'
;
import
withRouter
from
'umi/withRouter'
;
function
Layout
({
children
,
location
})
{
return
(
<
div
className
=
{
styles
.
normal
}
>
<
Header
location
=
{
location
}
/
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
main
}
>
{
children
}
<
/div
>
<
/div
>
<
/div
>
);
}
export
default
withRouter
(
Layout
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment