小程序獲取屏幕信息後怎麼在樣式設置

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;" >
相關文章
相關標籤/搜索