<van-list
v-model="loading"
:finished="finished"
finished-text="到底啦~"
@load="onLoad"
:immediate-check="false"
></van-list>
onLoad() {
this.currentPage++
this.getList().then((orderList) => {
//现有数据总和
this.orderList = this.orderList.concat(orderList.items);
this.loading = false;
//返回总条数小于等于现有数据
if (orderList.totalCount <= this.orderList.length) {
this.finished = true;
}
});
},
首次加载两次问题解决::immediate-check="false"
list只触发一次问题解决:如果返回总页数大于现有数据 需要this.currentPage++;并设置 this.finished = true;
注:设置 overflow 样式后一直触发加载
1702

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



