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
1cbb2b33
Commit
1cbb2b33
authored
Feb 08, 2021
by
言肆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix: runtimeSideWidth undefined"
This reverts commit
534fd82b
.
parent
534fd82b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
RouteContext.tsx
src/RouteContext.tsx
+0
-1
SiderMenu.tsx
src/SiderMenu/SiderMenu.tsx
+27
-26
No files found.
src/RouteContext.tsx
View file @
1cbb2b33
...
...
@@ -46,7 +46,6 @@ export interface RouteContextProps extends Partial<PureSettings>, MenuState {
hasFooterToolbar
?:
boolean
;
hasFooter
?:
boolean
;
setHasFooterToolbar
?:
(
bool
:
boolean
)
=>
void
;
collapsedWidth
?:
number
;
/* 附加属性 */
[
key
:
string
]:
any
;
}
...
...
src/SiderMenu/SiderMenu.tsx
View file @
1cbb2b33
...
...
@@ -92,6 +92,7 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
onOpenKeys
,
onSelect
,
breakpoint
,
collapsedWidth
=
48
,
menuExtraRender
=
false
,
menuContentRender
=
false
,
menuFooterRender
=
false
,
...
...
@@ -100,11 +101,13 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
const
{
getPrefixCls
}
=
useProProvider
();
const
context
=
useRouteContext
();
const
baseClassName
=
getPrefixCls
(
'sider'
);
const
collapsedWidth
=
context
.
collapsedWidth
||
48
;
// const isMix = computed(() => props.layout === 'mix');
// const fixed = computed(() => context.fixSiderbar);
const
runtimeTheme
=
computed
(()
=>
(
props
.
layout
===
'mix'
&&
'light'
)
||
props
.
navTheme
);
const
runtimeSideWidth
=
computed
(()
=>
(
props
.
collapsed
?
collapsedWidth
:
siderWidth
));
const
runtimeSideWidth
=
computed
(()
=>
props
.
collapsed
?
props
.
collapsedWidth
:
props
.
siderWidth
,
);
const
classNames
=
computed
(()
=>
{
return
{
...
...
@@ -174,7 +177,6 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
<
div
style=
"flex: 1; overflow: hidden auto;"
>
{
(
menuContentRender
&&
menuContentRender
(
props
,
defaultMenuDom
))
||
defaultMenuDom
}
</
div
>
{
!
context
.
isMobile
&&
(
<
div
class=
{
`${baseClassName}-links`
}
>
<
Menu
class=
{
`${baseClassName}-link-menu`
}
...
...
@@ -198,7 +200,6 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
</
Menu
.
Item
>
</
Menu
>
</
div
>
)
}
{
menuFooterRender
&&
<
div
class=
{
`${baseClassName}-footer`
}
>
{
menuFooterRender
(
props
)
}
</
div
>
}
</
Sider
>
</>
...
...
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