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
cdfcebd2
Unverified
Commit
cdfcebd2
authored
Mar 11, 2021
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fixedHeader not work state
parent
727b17f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
index.tsx
examples/index.tsx
+2
-5
Header.tsx
src/Header.tsx
+3
-1
No files found.
examples/index.tsx
View file @
cdfcebd2
...
...
@@ -29,7 +29,7 @@ const BasicLayout = defineComponent({
const
[
RouteContextProvider
]
=
createRouteContext
();
const
menuData
=
getMenuData
(
getRoutes
());
globalS
tate
.
menuData
=
menuData
;
s
tate
.
menuData
=
menuData
;
const
updateSelectedMenu
=
()
=>
{
const
matched
=
route
.
matched
.
concat
().
map
(
item
=>
item
.
path
);
...
...
@@ -65,12 +65,9 @@ const BasicLayout = defineComponent({
return
()
=>
(
<
RouteContextProvider
value=
{
state
}
>
<
ProLayout
i18n=
{
(
key
:
string
)
=>
key
}
layout=
{
state
.
layout
}
navTheme=
{
state
.
navTheme
}
i18n=
{
(
key
:
string
)
=>
key
}
isMobile=
{
state
.
isMobile
}
fixSiderbar=
{
state
.
fixSiderbar
}
fixedHeader=
{
state
.
fixedHeader
}
contentWidth=
{
'Fixed'
}
primaryColor=
{
'#1890ff'
}
contentStyle=
{
{
minHeight
:
'300px'
}
}
...
...
src/Header.tsx
View file @
cdfcebd2
...
...
@@ -71,7 +71,9 @@ export const HeaderView = defineComponent({
onCollapse
,
}
=
toRefs
(
props
);
const
context
=
useRouteContext
();
const
needFixedHeader
=
computed
(()
=>
fixedHeader
.
value
||
layout
.
value
===
'mix'
);
const
needFixedHeader
=
computed
(
()
=>
fixedHeader
.
value
||
context
.
fixedHeader
||
layout
.
value
===
'mix'
,
);
const
isTop
=
computed
(()
=>
layout
.
value
===
'top'
);
const
needSettingWidth
=
computed
(
()
=>
needFixedHeader
.
value
&&
hasSiderMenu
.
value
&&
!
isTop
.
value
&&
!
isMobile
.
value
,
...
...
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