Commit a35c630c authored by Sendya's avatar Sendya

fix: PageHeader extra, extraContent

parent bd5f016d
...@@ -14,6 +14,26 @@ ...@@ -14,6 +14,26 @@
console.log('PageHeader::.back') console.log('PageHeader::.back')
}" }"
> >
<template v-slot:extra>
<a-button-group style="margin-right: 4px;">
<a-button>操作</a-button>
<a-button>操作</a-button>
<a-button><a-icon type="ellipsis"/></a-button>
</a-button-group>
<a-button type="primary" >主操作</a-button>
</template>
<template v-slot:extraContent>
<a-row class="status-list">
<a-col :xs="12" :sm="12">
<div class="text">状态</div>
<div class="heading">待审批</div>
</a-col>
<a-col :xs="12" :sm="12">
<div class="text">订单金额</div>
<div class="heading">¥ 568.08</div>
</a-col>
</a-row>
</template>
<template v-slot:content> <template v-slot:content>
<span>{{ $t('pages.dashboard.analysis.content') }}</span> <span>{{ $t('pages.dashboard.analysis.content') }}</span>
</template> </template>
......
...@@ -95,6 +95,7 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => { ...@@ -95,6 +95,7 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => {
title, title,
content, content,
pageHeaderRender, pageHeaderRender,
extra,
extraContent, extraContent,
breadcrumb, breadcrumb,
back: handleBack, back: handleBack,
...@@ -109,6 +110,7 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => { ...@@ -109,6 +110,7 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => {
} }
let tabProps = { let tabProps = {
breadcrumb, breadcrumb,
extra,
title: i18nRender(pageHeaderTitle), title: i18nRender(pageHeaderTitle),
onBack: handleBack || noop, onBack: handleBack || noop,
footer: renderFooter(h, restProps, i18nRender) footer: renderFooter(h, restProps, i18nRender)
...@@ -117,8 +119,6 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => { ...@@ -117,8 +119,6 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => {
tabProps.backIcon = false tabProps.backIcon = false
} }
console.log('tabProps', tabProps)
return ( return (
<PageHeader { ...{ props: tabProps } }> <PageHeader { ...{ props: tabProps } }>
{renderPageHeader(h, content, extraContent)} {renderPageHeader(h, content, extraContent)}
...@@ -134,6 +134,7 @@ const PageHeaderWrapper = { ...@@ -134,6 +134,7 @@ const PageHeaderWrapper = {
render (h) { render (h) {
const children = this.$slots.default const children = this.$slots.default
const content = getComponentFromProp(this, 'content') const content = getComponentFromProp(this, 'content')
const extra = getComponentFromProp(this, 'extra')
const extraContent = getComponentFromProp(this, 'extraContent') const extraContent = getComponentFromProp(this, 'extraContent')
const pageMeta = useContext(this.$props.route || this.$route) const pageMeta = useContext(this.$props.route || this.$route)
...@@ -167,6 +168,7 @@ const PageHeaderWrapper = { ...@@ -167,6 +168,7 @@ const PageHeaderWrapper = {
const props = { const props = {
...this.$props, ...this.$props,
content, content,
extra,
extraContent, extraContent,
breadcrumb, breadcrumb,
tabChange, tabChange,
......
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