<template>
<view class="index">
<u-navbar :is-back="true" title="测试"" :title-width="650"></u-navbar>
<web-view :src="webSrc"></web-view>
</view>
</template>
<script>
export default {
name: "index",
data() {
return {
navHeight: 0,
webSrc: "",
};
},
onLoad() {
// APP-PLUS 才会启用
// #ifdef APP-PLUS
var that = this;
var height = 0;
var statusBarHeight = 0;
uni.getSystemInfo({
success: (sysinfo) => {
that.navHeight = 44;
height =
sysinfo.windowHeight - that.navHeight - sysinfo.statusBarHeight;
statusBarHeight = sysinfo.statusBarHeight;
},
complete: () => {},
});
var currentWebview = this.$scope.$getAppWebview();
setTimeout(function () {
var wv = currentWebview.children()[0];
wv.setStyle({
top: that.navHeight + statusBarHeight,
height: height,
});
}, 1000);
// #endif
}
};
</script>