小程序设置滚动条怎么设置高度
帮我看一下为什么用wx.getSystemInfo()
获取不到设备的高度:
js
Page({
data: {
scrollHeight:""
},
onLoad: function(options) {
let self=this;
wx.getSystemInfo({
success: function (res){
self.setData({
scrollHeight:res.windowHeight
})
},
})
}
})
html
<scroll-view class="scroll" scroll-y style="height:{{scrollHeight}}px">
目前的解决办法是设置style=“height:100%”