Commit 0e635b30 authored by Sendya's avatar Sendya

fix: layout `topmenu` menuRender invalid

parent ab48da19
...@@ -10,15 +10,17 @@ ...@@ -10,15 +10,17 @@
:siderWidth="208" :siderWidth="208"
v-bind="settings" v-bind="settings"
> >
<!-- <template v-slot:menuRender> <template v-slot:menuRender>
<div v-for="(menu, key) in menus" :key="key"> <ul style="color: white;">
{{ menu }} <li v-for="(menu, key) in menus" :key="key">
</div> {{ menu.meta.title }}
</template>--> </li>
</ul>
</template>
<template v-slot:menuHeaderRender> <template v-slot:menuHeaderRender>
<div> <div>
<img src="../assets/logo.svg" /> <img src="../assets/logo.svg" />
<h1>Pro Layout</h1> <h1>Pro 1</h1>
</div> </div>
</template> </template>
<template v-slot:headerContentRender> <template v-slot:headerContentRender>
......
...@@ -32,7 +32,7 @@ const renderContent = (h, props) => { ...@@ -32,7 +32,7 @@ const renderContent = (h, props) => {
const maxWidth = 1200 - 280 - 120 const maxWidth = 1200 - 280 - 120
const contentWidth = props.contentWidth === 'Fixed' const contentWidth = props.contentWidth === 'Fixed'
const baseCls = 'ant-pro-top-nav-header' 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 } const rightContentProps = { theme, isTop, isMobile }
let defaultDom = <GlobalHeader {...{ props: props }} /> let defaultDom = <GlobalHeader {...{ props: props }} />
if (isTop && !isMobile) { if (isTop && !isMobile) {
...@@ -47,7 +47,7 @@ const renderContent = (h, props) => { ...@@ -47,7 +47,7 @@ const renderContent = (h, props) => {
</div> </div>
)} )}
<div class={`${baseCls}-menu`} style={{ maxWidth: `${maxWidth}px`, flex: 1 }}> <div class={`${baseCls}-menu`} style={{ maxWidth: `${maxWidth}px`, flex: 1 }}>
<BaseMenu {...{ props: props }} /> {menuRender && (isFun(menuRender) && menuRender(h, props) || menuRender) || (<BaseMenu {...{ props: props }} />) }
</div> </div>
{isFun(rightContentRender) && rightContentRender(h, rightContentProps) || rightContentRender} {isFun(rightContentRender) && rightContentRender(h, rightContentProps) || rightContentRender}
</div> </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