若依第二页数据全部删除后显示无数据不展示第一页数据问题解决
【代码】若依第二页数据全部删除后显示无数据不展示第一页数据问题解决。
·
1.在getList()函数中加上判断,判断是否还有数据,若没有再次调用getList()函数。
/** 查询数据列表 */
getList() {
this.loading = true;
listData(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.dataList = response.rows;
/* 判断是否还有数据 */
if(response.rows.length>0){
this.getList();
}
this.total = response.total;
this.loading = false;
}
);
},
更多推荐
已为社区贡献2条内容
所有评论(0)