其他分享
首页 > 其他分享> > 计算 手机端页面高度和宽度

计算 手机端页面高度和宽度

作者:互联网

      init() {
                // 屏幕的高度
                let windowHeight = wx.getSystemInfoSync().windowHeight;
                let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
                let ratio = 750 / windowWidth;
                this.scroll_height = (windowHeight - 50) * ratio;
                console.log(this.scroll_height)
            },
            rightHeightFun() {
                // 屏幕的高度
                let windowHeight = wx.getSystemInfoSync().windowHeight;
                let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
                let ratio = 750 / windowWidth;
                this.rightHeight = (windowHeight - 95) * ratio;
            },

 

标签:getSystemInfoSync,windowWidth,ratio,宽度,let,windowHeight,手机,wx,页面
来源: https://www.cnblogs.com/Sabo-dudu/p/15142860.html