上拉触底判断
scrollEvent(e) {
const { scrollHeight, scrollTop, clientHeight } = e.target;
if (scrollHeight - scrollTop <= clientHeight) {
if (!this.loading) {
//处理触底具体逻辑
}
}
},
本文介绍如何使用JavaScript在移动端实现上拉触底加载更多数据的功能,包括关键的判断逻辑和实现细节。
上拉触底判断
scrollEvent(e) {
const { scrollHeight, scrollTop, clientHeight } = e.target;
if (scrollHeight - scrollTop <= clientHeight) {
if (!this.loading) {
//处理触底具体逻辑
}
}
},
2887
510
447
986
1458
2237

被折叠的 条评论
为什么被折叠?