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
bacc2031
Commit
bacc2031
authored
Mar 16, 2018
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix title can't be hidden in <img /> type icon when menu collapsed
parent
bf833b03
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
src/components/SiderMenu/SiderMenu.js
src/components/SiderMenu/SiderMenu.js
+1
-1
src/components/SiderMenu/index.less
src/components/SiderMenu/index.less
+14
-0
No files found.
src/components/SiderMenu/SiderMenu.js
View file @
bacc2031
...
...
@@ -14,7 +14,7 @@ const { SubMenu } = Menu;
// icon: <Icon type="setting" />,
const
getIcon
=
(
icon
)
=>
{
if
(
typeof
icon
===
'
string
'
&&
icon
.
indexOf
(
'
http
'
)
===
0
)
{
return
<
img
src
=
{
icon
}
alt
=
"
icon
"
className
=
{
styles
.
icon
}
/>
;
return
<
img
src
=
{
icon
}
alt
=
"
icon
"
className
=
{
`
${
styles
.
icon
}
sider-menu-item-img`
}
/>
;
}
if
(
typeof
icon
===
'
string
'
)
{
return
<
Icon
type
=
{
icon
}
/>
;
...
...
src/components/SiderMenu/index.less
View file @
bacc2031
...
...
@@ -49,4 +49,18 @@
.drawer .drawer-content {
background: #001529;
}
.ant-menu-inline-collapsed {
& > .ant-menu-item .sider-menu-item-img + span,
& > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item .sider-menu-item-img + span,
& > .ant-menu-submenu > .ant-menu-submenu-title .sider-menu-item-img + span {
max-width: 0;
display: inline-block;
opacity: 0;
}
}
.ant-menu-item .sider-menu-item-img + span,
.ant-menu-submenu-title .sider-menu-item-img + span {
transition: opacity .3s @ease-in-out, width .3s @ease-in-out;
opacity: 1;
}
}
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