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
bba32aa7
Commit
bba32aa7
authored
Jan 04, 2018
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #560
parent
9ace75b9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/components/SiderMenu/SiderMenu.js
src/components/SiderMenu/SiderMenu.js
+2
-4
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+2
-0
No files found.
src/components/SiderMenu/SiderMenu.js
View file @
bba32aa7
import
React
,
{
PureComponent
}
from
'
react
'
;
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
Layout
,
Menu
,
Icon
}
from
'
antd
'
;
import
{
Layout
,
Menu
,
Icon
}
from
'
antd
'
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Link
}
from
'
dva/router
'
;
import
logo
from
'
../../assets/logo.svg
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
import
{
getMenuData
}
from
'
../../common/menu
'
;
const
{
Sider
}
=
Layout
;
const
{
Sider
}
=
Layout
;
const
{
SubMenu
}
=
Menu
;
const
{
SubMenu
}
=
Menu
;
...
@@ -11,7 +9,7 @@ const { SubMenu } = Menu;
...
@@ -11,7 +9,7 @@ const { SubMenu } = Menu;
export
default
class
SiderMenu
extends
PureComponent
{
export
default
class
SiderMenu
extends
PureComponent
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
menus
=
getMenuData
()
;
this
.
menus
=
props
.
menuData
;
this
.
state
=
{
this
.
state
=
{
openKeys
:
this
.
getDefaultCollapsedSubMenus
(
props
),
openKeys
:
this
.
getDefaultCollapsedSubMenus
(
props
),
};
};
...
@@ -131,7 +129,7 @@ export default class SiderMenu extends PureComponent {
...
@@ -131,7 +129,7 @@ export default class SiderMenu extends PureComponent {
});
});
}
}
render
()
{
render
()
{
const
{
collapsed
,
location
:
{
pathname
},
onCollapse
}
=
this
.
props
;
const
{
logo
,
collapsed
,
location
:
{
pathname
},
onCollapse
}
=
this
.
props
;
const
{
openKeys
}
=
this
.
state
;
const
{
openKeys
}
=
this
.
state
;
// Don't show popup menu when it is been collapsed
// Don't show popup menu when it is been collapsed
const
menuProps
=
collapsed
?
{}
:
{
const
menuProps
=
collapsed
?
{}
:
{
...
...
src/layouts/BasicLayout.js
View file @
bba32aa7
...
@@ -129,6 +129,8 @@ class BasicLayout extends React.PureComponent {
...
@@ -129,6 +129,8 @@ class BasicLayout extends React.PureComponent {
const
layout
=
(
const
layout
=
(
<
Layout
>
<
Layout
>
<
SiderMenu
<
SiderMenu
logo
=
{
logo
}
menuData
=
{
getMenuData
()}
collapsed
=
{
collapsed
}
collapsed
=
{
collapsed
}
location
=
{
location
}
location
=
{
location
}
isMobile
=
{
this
.
state
.
isMobile
}
isMobile
=
{
this
.
state
.
isMobile
}
...
...
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