:style="'height: '+(emulator_Height+100)+'rpx; width:750rpx;'"
data(){
return{
emulator_Height: 0, //屏幕高度
}
},
onShow() {
// 獲取屏幕高度
let self = this;
uni.getSystemInfo({
success: function(res) {
console.log(res.screenHeight); //屏幕高度 注意這里獲得的高度寬度都是px 需要轉(zhuǎn)換rpx
console.log(res.windowWidth); //可使用窗口寬度
console.log(res.windowHeight); //可使用窗口高度
console.log(res.screenWidth); //屏幕寬度
self.emulator_Height = (res.screenHeight * (750 / res.windowWidth)) //將px 轉(zhuǎn)換rpx
console.log("rpx*********", self.emulator_Height)
}
});
}
uni鍵盤收起
uni.hideKeyboard()