Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
255a70b6
Commit
255a70b6
authored
May 14, 2018
by
jim
Committed by
้ๅธ
May 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize fixSiderbar
parent
a69e306c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
src/components/SiderMenu/index.js
src/components/SiderMenu/index.js
+1
-1
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+21
-9
No files found.
src/components/SiderMenu/index.js
View file @
255a70b6
...
...
@@ -20,7 +20,7 @@ const getFlatMenuKeys = menuData => {
};
const
SiderMenuWrapper
=
props
=>
props
.
isMobile
||
props
.
fixSiderbar
?
(
props
.
isMobile
?
(
<
DrawerMenu
parent
=
{
null
}
level
=
{
null
}
...
...
src/layouts/BasicLayout.js
View file @
255a70b6
...
...
@@ -75,6 +75,23 @@ class BasicLayout extends React.PureComponent {
}
return
title
;
}
getLayoutStyle
=
()
=>
{
const
{
fixSiderbar
}
=
this
.
props
;
if
(
fixSiderbar
)
{
return
{
height
:
'
100vh
'
,
overflow
:
'
auto
'
,
};
}
return
null
;
};
getContentStyle
=
()
=>
{
const
{
fixedHeader
}
=
this
.
props
;
return
{
margin
:
'
24px 24px 0
'
,
paddingTop
:
fixedHeader
?
64
:
0
,
};
};
getBashRedirect
=
()
=>
{
// According to the url parameter to redirect
// ่ฟ้ๆฏ้ๅฎๅ็,้ๅฎๅๅฐ url ็ redirect ๅๆฐๆ็คบๅฐๅ
...
...
@@ -101,8 +118,9 @@ class BasicLayout extends React.PureComponent {
payload
:
collapsed
,
});
};
render
()
{
const
{
isMobile
,
redirectData
,
routerData
,
fixedHeader
,
match
}
=
this
.
props
;
const
{
isMobile
,
redirectData
,
routerData
,
match
}
=
this
.
props
;
const
isTop
=
this
.
props
.
layout
===
'
topmenu
'
;
const
bashRedirect
=
this
.
getBashRedirect
();
const
myRedirectData
=
redirectData
||
[];
...
...
@@ -117,15 +135,9 @@ class BasicLayout extends React.PureComponent {
{...
this
.
props
}
/
>
)}
<
Layout
>
<
Layout
style
=
{
this
.
getLayoutStyle
()}
>
<
Header
handleMenuCollapse
=
{
this
.
handleMenuCollapse
}
logo
=
{
logo
}
{...
this
.
props
}
/
>
<
Content
style
=
{{
margin
:
'
24px 24px 0
'
,
height
:
'
100%
'
,
paddingTop
:
fixedHeader
?
64
:
0
,
}}
>
<
Content
style
=
{
this
.
getContentStyle
()}
>
<
Switch
>
{
myRedirectData
.
map
(
item
=>
(
<
Redirect
key
=
{
item
.
from
}
exact
from
=
{
item
.
from
}
to
=
{
item
.
to
}
/
>
...
...
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