html52.com
我爱小程序-开发者交流社区

小程序在PC端打开时如何适配PC的宽度和高度?

大家好,我在小程序上适配PC的宽度和高度时在app.js中使用如下语句,却提示windowWidth和windowHeigth没有定义,麻烦问下我该如何设置呢?谢谢


wx.getSystemInfo({

success: function (res) {

windowWidth = res.windowWidth;

windowHeigth = res.windowHeight;

}

})


网友回复

拾忆:

这个好像是JS的基础问题吧~你定义了那2个变量了吗?

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付