-
Notifications
You must be signed in to change notification settings - Fork 415
Open
Description
loadMore() {
this.busy = true;
setTimeout(() => {
this.pageSize.currentPage ++;
this.getShopListHander(true); //分页商品数据需要累加
}, 500)
},
这是请求接口的方法
async getShopListHander(flag) {
let res = await axios.get('/api/goods', {params: this.pageSize});
console.log(res);
if (res.data.code === 200) {
if (flag) {
this.datalist = [...this.datalist, ...res.data.data];
// 如果已经全部加载完毕, length = 0;
if (res.data.length === 0) {
this.busy = true;
} else {
this.busy = false;
}
} else {
this.datalist = res.data.data;
this.busy = true;
}
} else {
this.datalist = []
}
},
数据请求回来之后,我设置为false后。那时候滚动条距离底部
有很长的一段距离
。 自动发起请求了,直到数据请求完毕。
Metadata
Metadata
Assignees
Labels
No labels