guomouren

方法一:

 

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"

 

转自博客:https://www.jianshu.com/p/cfc7c63e63a7

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-01-07
  • 2022-01-08
猜你喜欢
  • 2022-02-07
  • 2022-01-07
  • 2021-11-18
  • 2021-11-30
  • 2022-01-08
  • 2022-01-08
  • 2022-03-01
相关资源
相似解决方案