微信小程序如何获取屏幕高度和宽度

方法一 onLoad: function () { this.setData({ height: wx.getSystemInfoSync().windowHeight, width: wx.getSystemInfoSync().windowWidth }) } 方法二 .index{ height: 100vh; width: 100vw; } # CSS3引入的"vw"和"vh"基于宽度/高度相对于窗口大小 # "vw" = "view width" "vh" = "view height"
联系我们

邮箱 626512443@qq.com
电话 18611320371(微信)
QQ群 235681453

Copyright © 2015-2022

备案号:京ICP备15003423号-3