Commit 0e635b30 authored by Sendya's avatar Sendya

fix: layout `topmenu` menuRender invalid

parent ab48da19
......@@ -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>
......
......@@ -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, menuRender, menuHeaderRender } = 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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment