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

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;">
posted @ 2018-12-23 17:25  惑心  阅读(497)  评论(0编辑  收藏  举报