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
8a2f180c
Commit
8a2f180c
authored
Sep 05, 2018
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor some code
parent
b16b5c3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/components/SiderMenu/SliderMenu.js
src/components/SiderMenu/SliderMenu.js
+10
-5
src/components/SiderMenu/index.less
src/components/SiderMenu/index.less
+1
-1
No files found.
src/components/SiderMenu/SliderMenu.js
View file @
8a2f180c
import
React
,
{
PureComponent
}
from
'
react
'
;
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
Layout
}
from
'
antd
'
;
import
{
Layout
}
from
'
antd
'
;
import
pathToRegexp
from
'
path-to-regexp
'
;
import
pathToRegexp
from
'
path-to-regexp
'
;
import
classNames
from
'
classnames
'
;
import
Link
from
'
umi/link
'
;
import
Link
from
'
umi/link
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
import
BaseMenu
,
{
getMenuMatches
}
from
'
./BaseMenu
'
;
import
BaseMenu
,
{
getMenuMatches
}
from
'
./BaseMenu
'
;
...
@@ -89,6 +90,12 @@ export default class SiderMenu extends PureComponent {
...
@@ -89,6 +90,12 @@ export default class SiderMenu extends PureComponent {
const
{
logo
,
collapsed
,
onCollapse
,
fixSiderbar
,
theme
}
=
this
.
props
;
const
{
logo
,
collapsed
,
onCollapse
,
fixSiderbar
,
theme
}
=
this
.
props
;
const
{
openKeys
}
=
this
.
state
;
const
{
openKeys
}
=
this
.
state
;
const
defaultProps
=
collapsed
?
{}
:
{
openKeys
};
const
defaultProps
=
collapsed
?
{}
:
{
openKeys
};
const
siderClassName
=
classNames
(
styles
.
sider
,
{
[
styles
.
fixSiderbar
]:
fixSiderbar
,
[
styles
.
light
]:
theme
===
'
light
'
,
});
return
(
return
(
<
Sider
<
Sider
trigger
=
{
null
}
trigger
=
{
null
}
...
@@ -97,11 +104,10 @@ export default class SiderMenu extends PureComponent {
...
@@ -97,11 +104,10 @@ export default class SiderMenu extends PureComponent {
breakpoint
=
"
lg
"
breakpoint
=
"
lg
"
onCollapse
=
{
onCollapse
}
onCollapse
=
{
onCollapse
}
width
=
{
256
}
width
=
{
256
}
className
=
{
`
${
styles
.
sider
}
${
fixSiderbar
?
styles
.
fixSiderbar
:
''
}
${
theme
=
{
theme
}
theme
===
'
light
'
?
styles
.
light
:
''
className
=
{
siderClassName
}
}
`
}
>
>
<
div
className
=
{
styles
.
logo
}
key
=
"
logo
"
id
=
"
logo
"
>
<
div
className
=
{
styles
.
logo
}
id
=
"
logo
"
>
<
Link
to
=
"
/
"
>
<
Link
to
=
"
/
"
>
<
img
src
=
{
logo
}
alt
=
"
logo
"
/>
<
img
src
=
{
logo
}
alt
=
"
logo
"
/>
<
h1
>
Ant
Design
Pro
<
/h1
>
<
h1
>
Ant
Design
Pro
<
/h1
>
...
@@ -109,7 +115,6 @@ export default class SiderMenu extends PureComponent {
...
@@ -109,7 +115,6 @@ export default class SiderMenu extends PureComponent {
<
/div
>
<
/div
>
<
BaseMenu
<
BaseMenu
{...
this
.
props
}
{...
this
.
props
}
key
=
"
Menu
"
mode
=
"
inline
"
mode
=
"
inline
"
handleOpenChange
=
{
this
.
handleOpenChange
}
handleOpenChange
=
{
this
.
handleOpenChange
}
onOpenChange
=
{
this
.
handleOpenChange
}
onOpenChange
=
{
this
.
handleOpenChange
}
...
...
src/components/SiderMenu/index.less
View file @
8a2f180c
@import '~antd/lib/style/themes/default.less';
@import '~antd/lib/style/themes/default.less';
@ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86);
.logo {
.logo {
height: 64px;
height: 64px;
position: relative;
position: relative;
...
...
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