提交 d4aea922 编写于 作者: 雪洛's avatar 雪洛

update: H5支持titlePenetrate

上级 1ce1a360
...@@ -140,6 +140,10 @@ export default { ...@@ -140,6 +140,10 @@ export default {
transparentTitle: { transparentTitle: {
type: String, type: String,
default: 'none' default: 'none'
},
titlePenetrate: {
type: String,
default: 'NO'
} }
}, },
data () { data () {
...@@ -148,6 +152,11 @@ export default { ...@@ -148,6 +152,11 @@ export default {
'auto': 'transparent', 'auto': 'transparent',
'always': 'float' 'always': 'float'
} }
const yesNoParseList = {
'YES': true,
'NO': false
}
const navigationBar = mergeTitleNView({ const navigationBar = mergeTitleNView({
loading: false, loading: false,
...@@ -159,7 +168,8 @@ export default { ...@@ -159,7 +168,8 @@ export default {
duration: '0', duration: '0',
timingFunc: '', timingFunc: '',
type: titleNViewTypeList[this.transparentTitle], type: titleNViewTypeList[this.transparentTitle],
transparentTitle: this.transparentTitle transparentTitle: this.transparentTitle,
titlePenetrate: yesNoParseList[this.titlePenetrate]
}, this.titleNView) }, this.titleNView)
const showNavigationBar = this.navigationStyle === 'default' && this.titleNView const showNavigationBar = this.navigationStyle === 'default' && this.titleNView
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<uni-page-head :uni-page-head-type="type"> <uni-page-head :uni-page-head-type="type">
<div <div
:style="{transitionDuration:duration,transitionTimingFunction:timingFunc,backgroundColor:bgColor,color:textColor}" :style="{transitionDuration:duration,transitionTimingFunction:timingFunc,backgroundColor:bgColor,color:textColor}"
:class="{'uni-page-head-transparent':type==='transparent'}" :class="{'uni-page-head-transparent':type==='transparent','uni-page-head-titlePenetrate': titlePenetrate}"
class="uni-page-head" class="uni-page-head"
> >
<div class="uni-page-head-hd"> <div class="uni-page-head-hd">
...@@ -95,8 +95,9 @@ ...@@ -95,8 +95,9 @@
</template> </template>
</div> </div>
</div> </div>
<div <div
v-if="type!=='transparent'&&type!=='float'" v-if="type!=='transparent'&&type!=='float'"
:class="{'uni-placeholder-titlePenetrate': titlePenetrate}"
class="uni-placeholder"/> class="uni-placeholder"/>
</uni-page-head> </uni-page-head>
</template> </template>
...@@ -120,6 +121,16 @@ uni-page-head .uni-page-head { ...@@ -120,6 +121,16 @@ uni-page-head .uni-page-head {
color: #fff; color: #fff;
background-color: #000; background-color: #000;
transition-property: all; transition-property: all;
}
uni-page-head .uni-page-head-titlePenetrate,
uni-page-head .uni-page-head-titlePenetrate .uni-page-head-bd,
uni-page-head .uni-page-head-titlePenetrate .uni-page-head-bd * {
pointer-events: none;
}
uni-page-head .uni-page-head-titlePenetrate *{
pointer-events: auto;
} }
uni-page-head .uni-page-head.uni-page-head-transparent .uni-page-head-ft > div { uni-page-head .uni-page-head.uni-page-head-transparent .uni-page-head-ft > div {
...@@ -129,6 +140,10 @@ uni-page-head .uni-page-head.uni-page-head-transparent .uni-page-head-ft > div { ...@@ -129,6 +140,10 @@ uni-page-head .uni-page-head.uni-page-head-transparent .uni-page-head-ft > div {
uni-page-head .uni-page-head ~ .uni-placeholder { uni-page-head .uni-page-head ~ .uni-placeholder {
width: 100%; width: 100%;
height: 44px; height: 44px;
}
uni-page-head .uni-placeholder-titlePenetrate{
pointer-events: none;
} }
uni-page-head .uni-page-head * { uni-page-head .uni-page-head * {
...@@ -363,6 +378,10 @@ export default { ...@@ -363,6 +378,10 @@ export default {
validator (value) { validator (value) {
return ['none', 'auto', 'always'].indexOf(value) !== -1 return ['none', 'auto', 'always'].indexOf(value) !== -1
} }
},
titlePenetrate: {
type: Boolean,
default: false
} }
}, },
data () { data () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册