Bootstrap

uniapp:webview全屏不显示导航栏解决方案

<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>

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;