vue 列表 分页 按日期归类
作者:
懿小诺 | 来源:发表于
2021-11-25 11:28 被阅读0次 if (that.pageIdx == 1) {
this.dataList_0 = newArr;//第一页的数据 直接加进来
} else {
//第二页的数据 判断日期是不是一样
for (let i = 0; i < newArr.length; i++) {
const _obj = newArr[i];
if (_obj.dateStr == this.dataList_0[this.dataList_0.length - 1].dateStr) {
this.dataList_0[this.dataList_0.length - 1].childList = this.dataList_0[
this.dataList_0.length - 1
].childList.concat(newArr[0].childList);
} else {
this.dataList_0.push(newArr[i]); //数组追加
}
}
}
//没有数据时候 结束分页
if (that.dataList_0.length == 0) {
that.noDataTip = '';
that.upFinished = true;
that.noData = true;
return;
} else {
that.noDataTip = '- 显示近30天内的历史任务记录 -';
that.noData = false;
}
if (res.data.result.hasMore == 1) {
that.upFinished = true;
}
本文标题:vue 列表 分页 按日期归类
本文链接:https://www.haomeiwen.com/subject/jipatrtx.html
网友评论