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
0e635b30
Commit
0e635b30
authored
Jan 20, 2021
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: layout `topmenu` menuRender invalid
parent
ab48da19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
BasicLayout.vue
examples/src/layouts/BasicLayout.vue
+8
-6
Header.jsx
src/Header.jsx
+2
-2
No files found.
examples/src/layouts/BasicLayout.vue
View file @
0e635b30
...
...
@@ -10,15 +10,17 @@
:siderWidth=
"208"
v-bind=
"settings"
>
<!--
<template
v-slot:menuRender
>
<div
v-for=
"(menu, key) in menus"
:key=
"key"
>
{{
menu
}}
</div>
</
template
>
-->
<template
v-slot:menuRender
>
<ul
style=
"color: white;"
>
<li
v-for=
"(menu, key) in menus"
:key=
"key"
>
{{
menu
.
meta
.
title
}}
</li>
</ul>
</
template
>
<
template
v-slot:menuHeaderRender
>
<div>
<img
src=
"../assets/logo.svg"
/>
<h1>
Pro
Layout
</h1>
<h1>
Pro
1
</h1>
</div>
</
template
>
<
template
v-slot:headerContentRender
>
...
...
src/Header.jsx
View file @
0e635b30
...
...
@@ -32,7 +32,7 @@ const renderContent = (h, props) => {
const
maxWidth
=
1200
-
280
-
120
const
contentWidth
=
props
.
contentWidth
===
'Fixed'
const
baseCls
=
'ant-pro-top-nav-header'
const
{
logo
,
title
,
theme
,
isMobile
,
headerRender
,
rightContentRender
,
menuHeaderRender
}
=
props
const
{
logo
,
title
,
theme
,
isMobile
,
headerRender
,
rightContentRender
,
menu
Render
,
menu
HeaderRender
}
=
props
const
rightContentProps
=
{
theme
,
isTop
,
isMobile
}
let
defaultDom
=
<
GlobalHeader
{
...
{
props
:
props
}}
/>
if
(
isTop
&&
!
isMobile
)
{
...
...
@@ -47,7 +47,7 @@ const renderContent = (h, props) => {
</
div
>
)
}
<
div
class=
{
`${baseCls}-menu`
}
style=
{
{
maxWidth
:
`${maxWidth}px`
,
flex
:
1
}
}
>
<
BaseMenu
{
...
{
props
:
props
}}
/>
{
menuRender
&&
(
isFun
(
menuRender
)
&&
menuRender
(
h
,
props
)
||
menuRender
)
||
(<
BaseMenu
{
...
{
props
:
props
}}
/>)
}
</
div
>
{
isFun
(
rightContentRender
)
&&
rightContentRender
(
h
,
rightContentProps
)
||
rightContentRender
}
</
div
>
...
...
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