var that = this; // 获取左边高度
var query = tt.createSelectorQuery();
query.select('#sbtop').boundingClientRect(function (rect) {
that.setData({
tab: rect.height
});
}).exec();
query.select('#arrow').boundingClientRect(function (rect) {
that.setData({
arrow: rect.height
});
}).exec(); //不滑动页面的高度
let allWidth, allHeight;
tt.getSystemInfo({
success: function (res, rect) {
that.setData({
allWidth: res.windowWidth,
allHeight: res.windowHeight
});
}
});
},
结果显示: RangeError: Invalid array length
报无效的数组长度 。说明 你调用了lengeh方法 。但你这个 数组 不存在 或者 不是数组