scrollToBottom: function () {
var that = this;
var query = uni.createSelectorQuery();
query.selectAll('.m-item').boundingClientRect();
query.select('#scrollview').boundingClientRect();
query.exec(function (res) {
//h5端此处打印res显示res[0]是空数组
console.log(res)
that.style.mitemHeight = 0;
res[0].forEach(function (rect) {
console.info(rect.height);
that.style.mitemHeight = that.style.mitemHeight + rect.height + 20;
});
that.scrollTop = 600
if (that.style.mitemHeight > that.style.contentViewHeight) {
that.scrollTop = that.style.mitemHeight - that.style.contentViewHeight;
}
});
}
请问这个怎么处理
0 个回复