UniApp开发--动态计算控价高度

页面代码:

计算公式:

const that = this;

uni.createSelectorQuery().select(".header").boundingClientRect((header) => {

         uni.createSelectorQuery().select(".chat-list").boundingClientRect((chatList) => {

                uni.createSelectorQuery().select(".send-box").boundingClientRect((sendBox) => {

                       console.log(header.height);

                       const windowHeight = uni.getSystemInfoSync()['windowHeight'];

                       const height = (windowHeight /* - header.height */ - chatList.bottom - sendBox.height);

                       that.chatViewHeight = height + 'px';

                }).exec();

       }).exec();

}).exec();

你可能感兴趣的:(UniApp开发--动态计算控价高度)