在app中如何使weib-view不铺满全屏,自适应页面
2024-10-21 23:12:20
// #ifdef APP-PLUS
//自建webview
var currentWebview = this.$scope.$getAppWebview();
var height = this.windowHeight - this.topHeight;
if (this.activeIndex == 1) {
var type = uni.getSystemInfoSync().platform; //判断是ios还是安卓
wv = plus.webview.create(this.docUrl, "webview", {
plusrequire: "none",
'uni-app': 'none',
top: type == 'android' ? this.topHeight + 90 : this.topHeight + 75,
scalable: true,
height: height
})
currentWebview.append(wv);
} else {
plus.webview.close(wv);
}
// #endif
<web-view :src="docUrl"></web-view>我
var currentWebview = this.$scope.$getAppWebview();//此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
我这里是点击tab选项卡展示
// #ifdef APP-PLUS
//自建webview
var currentWebview = this.$scope.$getAppWebview();
var height = this.windowHeight - this.topHeight;
if (this.activeIndex == 1) {
var type = uni.getSystemInfoSync().platform; //判断是ios还是安卓
wv = plus.webview.create(this.docUrl, "webview", {
plusrequire: "none",
'uni-app': 'none',
top: type == 'android' ? this.topHeight + 90 : this.topHeight + 75,
scalable: true,
height: height
})
currentWebview.append(wv);
} else {
plus.webview.close(wv);
}
// #endif
最新文章
- 在Ubuntu下安装ISE并给Atlys板子编程
- mysql IP转换函数
- j2ee分布式缓存同步实现方案dlcache v1.0.0
- webkit,HTML5头部标签
- [leetcode] 401. Binary Watch
- FE: CSS固定图片显示大小及GitHub Pages在线演示
- 分享一个C#自定义事件的实际应用
- Supervisor: A Process Control System
- 20155215 第二周测试1 与 myod
- hdu 1043(经典搜索)
- 【一天一道LeetCode】#169. Majority Element
- javascript语言扩展:可迭代对象(2)
- 利用Swagger2自动生成对外接口的文档
- Jenkins系统监测(转)
- git add 添加多个文件
- Azure monitor Portal 、Azure monitor API监控指标、性能监视器常用指标
- QVariant类
- Aseprite入门教程
- 使用位图字体工具BMFont从图片生成自定义字体
- HashMap的源码分析