提交 88ef44bb 编写于 作者: fxy060608's avatar fxy060608

fix(h5): topWindow with navigationBar

上级 d25ea6ec
......@@ -15,7 +15,7 @@
<v-uni-top-window
ref="top"
:navigation-bar-title-text="navigationBarTitleText"
v-bind="bindWindow"
v-bind="bindWindow"
@hook:mounted="onTopWindowInit"
/>
</div>
......@@ -33,8 +33,8 @@
<uni-left-window
v-if="leftWindow"
v-show="showLeftWindow || apiShowLeftWindow"
ref="leftWindow"
:data-show="apiShowLeftWindow"
ref="leftWindow"
:data-show="apiShowLeftWindow"
:style="leftWindowStyle"
>
<div
......@@ -53,8 +53,8 @@
<uni-right-window
v-if="rightWindow"
v-show="showRightWindow || apiShowRightWindow"
ref="rightWindow"
:data-show="apiShowRightWindow"
ref="rightWindow"
:data-show="apiShowRightWindow"
:style="rightWindowStyle"
>
<div
......@@ -330,7 +330,7 @@ export default {
}
uni-main {
flex: 1;
flex: 1;
width: 100%;
}
......
<template>
<uni-page :data-page="$route.meta.pagePath">
<page-head
v-if="!hasTopWindow && navigationBar.type!=='none'"
v-if="!showTopWindow && navigationBar.type!=='none'"
v-bind="navigationBar"
/>
<page-refresh
......@@ -32,8 +32,6 @@
}
</style>
<script>
import Vue from 'vue'
import {
upx2px
} from 'uni-helpers/index'
......@@ -163,13 +161,12 @@ export default {
}
},
topWindow: {
type: Boolean,
type: Boolean,
default: true
}
},
data () {
// 目前简单处理,存在topWindow时,始终不显示page head
const hasTopWindow = this.topWindow !== false && !!Vue.component('VUniTopWindow')
let navigationBar = {}
const titleNViewTypeList = {
none: 'default',
......@@ -240,11 +237,19 @@ export default {
refreshOptions.range = upx2px(refreshOptions.range)
return {
hasTopWindow,
navigationBar,
refreshOptions
}
},
computed: {
showTopWindow () {
try {
const appLayout = getApp().$children[0].$children[0]
return appLayout && appLayout.showTopWindow
} catch (e) {}
return false
}
},
created () {
const navigationBar = this.navigationBar
document.title = navigationBar.titleText
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册