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
a35c630c
Commit
a35c630c
authored
May 04, 2020
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: PageHeader extra, extraContent
parent
bd5f016d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
analysis.vue
examples/src/views/dashboard/analysis.vue
+20
-0
index.jsx
src/components/PageHeaderWrapper/index.jsx
+4
-2
No files found.
examples/src/views/dashboard/analysis.vue
View file @
a35c630c
...
@@ -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
>
...
...
src/components/PageHeaderWrapper/index.jsx
View file @
a35c630c
...
@@ -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
,
...
...
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