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