大家好,我在小程序上适配PC的宽度和高度时在app.js中使用如下语句,却提示windowWidth和windowHeigth没有定义,麻烦问下我该如何设置呢?谢谢
wx.getSystemInfo({
success: function (res) {
windowWidth = res.windowWidth;
windowHeigth = res.windowHeight;
}
})
网友回复
拾忆:
这个好像是JS的基础问题吧~你定义了那2个变量了吗?
大家好,我在小程序上适配PC的宽度和高度时在app.js中使用如下语句,却提示windowWidth和windowHeigth没有定义,麻烦问下我该如何设置呢?谢谢
wx.getSystemInfo({
success: function (res) {
windowWidth = res.windowWidth;
windowHeigth = res.windowHeight;
}
})
这个好像是JS的基础问题吧~你定义了那2个变量了吗?