Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-layout
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
pro-layout
Commits
b2f35b9c
Commit
b2f35b9c
authored
May 15, 2020
by
liangliangyin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: collapsed sidermenu paddingLeft
parent
1b05b728
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
package.json
package.json
+1
-1
BasicLayout.jsx
src/BasicLayout.jsx
+19
-2
No files found.
package.json
View file @
b2f35b9c
{
"name"
:
"@ant-design-vue/pro-layout"
,
"version"
:
"0.2.
7
"
,
"version"
:
"0.2.
8
"
,
"main"
:
"./lib/index.js"
,
"module"
:
"./es/index.js"
,
"repository"
:
{
...
...
src/BasicLayout.jsx
View file @
b2f35b9c
...
...
@@ -63,6 +63,17 @@ const MediaQueryEnum = {
}
}
const
getPaddingLeft
=
(
hasLeftPadding
,
collapsed
=
undefined
,
siderWidth
)
=>
{
if
(
hasLeftPadding
)
{
return
collapsed
?
80
:
siderWidth
}
return
undefined
}
const
headerRender
=
(
h
,
props
)
=>
{
if
(
props
.
headerRender
===
false
)
{
return
null
...
...
@@ -97,10 +108,14 @@ const BasicLayout = {
const
collapsedButtonRender
=
getComponentFromProp
(
content
,
'collapsedButtonRender'
)
const
menuHeaderRender
=
getComponentFromProp
(
content
,
'menuHeaderRender'
)
const
isTopMenu
=
layout
===
'topmenu'
const
hasSiderMenu
=
!
isTopMenu
// If it is a fix menu, calculate padding
// don't need padding in phone mode
const
hasLeftPadding
=
fixSiderbar
&&
!
isTopMenu
&&
!
isMobile
const
cdProps
=
{
...
props
,
hasSiderMenu
:
!
isTopMenu
,
hasSiderMenu
,
footerRender
,
menuHeaderRender
,
rightContentRender
,
...
...
@@ -121,7 +136,9 @@ const BasicLayout = {
onCollapse=
{
handleCollapse
}
/>
<
Layout
class=
{
[
layout
]
}
style=
{
{
paddingLeft
:
fixSiderbar
?
`${siderWidth}px`
:
'0'
,
paddingLeft
:
hasSiderMenu
?
`${getPaddingLeft(!!hasLeftPadding, collapsed, siderWidth)}px`
:
undefined
,
minHeight
:
'100vh'
}
}
>
{
headerRender
(
h
,
{
...
...
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