在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 微信小程序設置getSystemInfo怎么在wxml輸出無效?

微信小程序設置getSystemInfo怎么在wxml輸出無效?

js:
getSystemInfo() {

wx.getSystemInfo({
  success: function (res) {
    deviceWidth:res.windowWidth
    deviceHeight:res.windowHeight
  }
})

},
onLoad() {

this.getSystemInfo()

},

wxml:

<scroll-view scroll-y="true" style="height:{{ deviceHeight }}"  scroll-into-view="{{toView}}"  bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" >

wx.getSystemInfo已經獲得了寬高 在輸出卻是0

回答
編輯回答
故林

onLoad() {

var self = this
wx.getSystemInfo({
  success: function (res) {
    self.setData({
      deviceWidth: res.windowWidth,
      deviceHeight: res.windowHeight,
    })
  }
})

},

2018年1月22日 02:29