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

      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;
            },

 

上一篇:Dirt Ratio 线段树+二分 T13 D43


下一篇:控制容器的宽高比---aspect-ratio