"screenOrientation" : [
"portrait-primary",
"portrait-secondary",
"landscape-secondary",
"landscape-primary"
],
onResize() {
let _this = this;
_this.setResize();
},
setResize() {
let _this = this;
let isIOS = this.getIsIOS();
if(!isIOS){
setTimeout(function() {
const systemInfo = uni.getSystemInfoSync();
this.windowWidth = systemInfo.windowWidth;
this.windowHeight = systemInfo.windowHeight;
console.log('Window width:', this.windowWidth);
console.log('Window height:', this.windowHeight);
console.error("强行刷新")
},100);
}
},
2 个回复
1***@qq.com - 小海
是的我也是 其他页对着 首页横屏但是内容是竖屏计算的大小
1***@qq.com - 小海
只能在main.js加
plus.screen.lockOrientation("landscape-primary"); //横屏,因为项目配置的横屏可能有bug