uniapp 获取scroll-view 高度的问题

        // 计算屏幕剩余高度  填补剩余高度
            let _this = this
            uni.getSystemInfo({
                success(res) {
                    _this.phoneHeight = res.windowHeight
                    console.log(res.windowHeight)
                    // 计算组件的高度
                    let view = uni.createSelectorQuery().select(".hd-height")
                    view.boundingClientRect(data => {
                        _this.navHeight = data.height
                        console.log(_this.navHeight)
                        _this.scrollviewHigh = _this.phoneHeight - _this.navHeight
                
                    }).exec()
                }
            })this

最后强制绑定style  get

得到的高度单位是 px  不是 console

相关文章
相关标签/搜索