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
3c2a056e
Commit
3c2a056e
authored
Aug 20, 2018
by
ohhoney1
Committed by
εε³
Aug 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug: cannot set light theme correctly
parent
a6aebc68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/components/SiderMenu/SiderMenu.js
src/components/SiderMenu/SiderMenu.js
+8
-4
src/components/SiderMenu/index.less
src/components/SiderMenu/index.less
+1
-1
No files found.
src/components/SiderMenu/SiderMenu.js
View file @
3c2a056e
...
@@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
import
{
Layout
,
Menu
,
Icon
}
from
'
antd
'
;
import
{
Layout
,
Menu
,
Icon
}
from
'
antd
'
;
import
pathToRegexp
from
'
path-to-regexp
'
;
import
pathToRegexp
from
'
path-to-regexp
'
;
import
{
Link
}
from
'
dva/router
'
;
import
{
Link
}
from
'
dva/router
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
import
{
urlToList
}
from
'
../_utils/pathTools
'
;
import
{
urlToList
}
from
'
../_utils/pathTools
'
;
...
@@ -75,8 +76,7 @@ export default class SiderMenu extends PureComponent {
...
@@ -75,8 +76,7 @@ export default class SiderMenu extends PureComponent {
getDefaultCollapsedSubMenus
(
props
)
{
getDefaultCollapsedSubMenus
(
props
)
{
const
{
const
{
location
:
{
pathname
},
location
:
{
pathname
},
}
=
}
=
props
||
this
.
props
;
props
||
this
.
props
;
return
getMenuMatchKeys
(
this
.
flatMenuKeys
,
urlToList
(
pathname
));
return
getMenuMatchKeys
(
this
.
flatMenuKeys
,
urlToList
(
pathname
));
}
}
...
@@ -212,6 +212,10 @@ export default class SiderMenu extends PureComponent {
...
@@ -212,6 +212,10 @@ export default class SiderMenu extends PureComponent {
render
()
{
render
()
{
const
{
logo
,
menuData
,
collapsed
,
onCollapse
}
=
this
.
props
;
const
{
logo
,
menuData
,
collapsed
,
onCollapse
}
=
this
.
props
;
const
{
openKeys
}
=
this
.
state
;
const
{
openKeys
}
=
this
.
state
;
const
theme
=
'
dark
'
;
const
siderClass
=
classNames
(
styles
.
sider
,
{
[
styles
.
light
]:
theme
===
'
light
'
,
});
// 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
?
{}
?
{}
...
@@ -231,7 +235,7 @@ export default class SiderMenu extends PureComponent {
...
@@ -231,7 +235,7 @@ export default class SiderMenu extends PureComponent {
breakpoint
=
"
lg
"
breakpoint
=
"
lg
"
onCollapse
=
{
onCollapse
}
onCollapse
=
{
onCollapse
}
width
=
{
256
}
width
=
{
256
}
className
=
{
s
tyles
.
sider
}
className
=
{
s
iderClass
}
>
>
<
div
className
=
{
styles
.
logo
}
key
=
"
logo
"
>
<
div
className
=
{
styles
.
logo
}
key
=
"
logo
"
>
<
Link
to
=
"
/
"
>
<
Link
to
=
"
/
"
>
...
@@ -241,7 +245,7 @@ export default class SiderMenu extends PureComponent {
...
@@ -241,7 +245,7 @@ export default class SiderMenu extends PureComponent {
<
/div
>
<
/div
>
<
Menu
<
Menu
key
=
"
Menu
"
key
=
"
Menu
"
theme
=
"
dark
"
theme
=
{
theme
}
mode
=
"
inline
"
mode
=
"
inline
"
{...
menuProps
}
{...
menuProps
}
onOpenChange
=
{
this
.
handleOpenChange
}
onOpenChange
=
{
this
.
handleOpenChange
}
...
...
src/components/SiderMenu/index.less
View file @
3c2a056e
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
position: relative;
position: relative;
z-index: 10;
z-index: 10;
&.lig
th
{
&.lig
ht
{
background-color: white;
background-color: white;
.logo {
.logo {
background: white;
background: white;
...
...
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