小程序获取屏幕信息后怎么在样式设置

js:获取系统信息
var that = this ;
wx.getSystemInfo({
       success: function (res) {
        that.setData({
           winWidth: res.windowWidth,
           winheight: res.windowHeight
         });
       }
     });
 
css:设置样式:
< view  style = "width:{{winWidth}}px;height:{{winheight}}px;" >

猜你喜欢

转载自www.cnblogs.com/lvlina/p/10164900.html