wxml:
<scroll-view class="scroll" scroll-y="true" style="height:{{clientHeight?clientHeight+'px':'auto'}}">
js:
onShow: function (options) {
wx.setNavigationBarTitle({
title: options.title
});
var that = this;//
用在wx的API中要用that不能用this
wx.getSystemInfo({
success: function (res) {
var height = res.windowHeight-46;//
1rpx=0.5px
console.log(height);
that.setData({
clientHeight: height
})
}
});
},