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
96c2204d
Commit
96c2204d
authored
May 04, 2020
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rm PageHeader backIcon
parent
5bcb2dbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
15 deletions
+30
-15
app.js
examples/src/store/modules/app.js
+3
-3
index.jsx
src/components/PageHeaderWrapper/index.jsx
+27
-12
No files found.
examples/src/store/modules/app.js
View file @
96c2204d
...
...
@@ -13,11 +13,11 @@ import {
// i18n
APP_LANGUAGE
}
from
'../mutation-types'
import
{
loadLanguageAsync
}
from
'
../..
/locales'
import
{
loadLanguageAsync
}
from
'
@
/locales'
const
App
=
{
state
:
{
side
bar
:
true
,
side
Collapsed
:
true
,
device
:
'desktop'
,
theme
:
'dark'
,
layout
:
''
,
...
...
@@ -31,7 +31,7 @@ const App = {
},
mutations
:
{
[
SIDEBAR_TYPE
]:
(
state
,
type
)
=>
{
state
.
side
bar
=
type
state
.
side
Collapsed
=
type
Vue
.
ls
.
set
(
SIDEBAR_TYPE
,
type
)
},
[
TOGGLE_DEVICE
]:
(
state
,
device
)
=>
{
...
...
src/components/PageHeaderWrapper/index.jsx
View file @
96c2204d
...
...
@@ -19,7 +19,7 @@ const PageHeaderTabConfig = {
const
PageHeaderWrapperProps
=
{
...
PageHeaderTabConfig
,
...
PageHeaderProps
,
title
:
PropTypes
.
oneOf
([
PropTypes
.
string
,
false
]),
title
:
PropTypes
.
oneOf
Type
([
PropTypes
.
string
,
PropTypes
.
bool
]),
content
:
PropTypes
.
any
,
extraContent
:
PropTypes
.
any
,
pageHeaderRender
:
PropTypes
.
func
,
...
...
@@ -38,6 +38,9 @@ const useContext = (route) => {
}
||
null
}
const
noop
=
()
=>
{}
// TODO :: tabList tab 支持图标 优化
const
renderFooter
=
(
h
,
tabConfigProps
,
i18nRender
)
=>
{
const
{
tabList
,
...
...
@@ -101,17 +104,23 @@ const defaultPageHeaderRender = (h, props, pageMeta, i18nRender) => {
return
pageHeaderRender
({
...
props
})
}
let
pageHeaderTitle
=
title
if
(
(
!
title
&&
title
!==
false
)
||
pageMeta
.
title
!==
false
)
{
if
(
!
title
&&
title
!==
false
)
{
pageHeaderTitle
=
pageMeta
.
title
}
let
tabProps
=
{
breadcrumb
,
title
:
i18nRender
(
pageHeaderTitle
),
onBack
:
handleBack
||
noop
,
footer
:
renderFooter
(
h
,
restProps
,
i18nRender
)
}
if
(
!
handleBack
)
{
tabProps
.
backIcon
=
false
}
console
.
log
(
'tabProps'
,
tabProps
)
return
(
<
PageHeader
title=
{
i18nRender
(
pageHeaderTitle
)
}
breadcrumb=
{
breadcrumb
}
{
...
props
}
onBack=
{
handleBack
}
footer=
{
renderFooter
(
h
,
restProps
,
i18nRender
)
}
>
<
PageHeader
{
...
{
props
:
tabProps
}
}
>
{
renderPageHeader
(
h
,
content
,
extraContent
)
}
</
PageHeader
>
)
...
...
@@ -129,11 +138,18 @@ const PageHeaderWrapper = {
const
pageMeta
=
useContext
(
this
.
$props
.
route
||
this
.
$route
)
const
i18n
=
this
.
$props
.
i18nRender
||
this
.
locale
||
defaultI18nRender
// 当未设置 back props 或未监听 @back,不显示 back
const
onBack
=
this
.
$props
.
back
const
back
=
()
=>
{
const
back
=
onBack
&&
(
()
=>
{
this
.
$emit
(
'back'
)
// call props back func
onBack
&&
onBack
()
})
||
undefined
const
onTabChange
=
this
.
$props
.
tabChange
const
tabChange
=
(
key
)
=>
{
this
.
$emit
(
'tabChange'
,
key
)
onTabChange
&&
onTabChange
(
key
)
}
const
propsBreadcrumb
=
this
.
$props
.
breadcrumb
...
...
@@ -148,13 +164,12 @@ const PageHeaderWrapper = {
breadcrumb
=
{
props
:
{
routes
}}
}
console
.
log
(
'breadcrumb'
,
breadcrumb
)
const
props
=
{
...
this
.
$props
,
content
,
extraContent
,
breadcrumb
,
tabChange
,
back
}
...
...
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