var that = this; /** * 获取当前设备的宽高 */ wx.getSystemInfo({ success: function (res) { that.setData({ clientHeight: res.windowHeight -30 }); } });
style="height: {{clientHeight?clientHeight+'px':'auto'}}"