1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 21:29:31 +08:00

fix: 修复首页加载异常问题

This commit is contained in:
小莫唐尼
2024-05-22 00:43:24 +08:00
parent f6069cad95
commit 512a4013b9
16 changed files with 366 additions and 62 deletions
+4 -3
View File
@@ -47,8 +47,9 @@
},
name: '',
pageTitle: '加载中...',
result: null,
dataList: [],
hasNext:false,
isLoadMore: false,
loadMoreText: ''
};
@@ -66,7 +67,7 @@
this.fnGetData();
},
onReachBottom(e) {
if (this.result && this.result.hasNext) {
if (this.hasNext) {
this.queryParams.page += 1;
this.isLoadMore = true;
this.fnGetData();
@@ -92,7 +93,7 @@
.getPostByTagName(this.name, this.queryParams)
.then(res => {
this.fnSetPageTitle(`${this.pageTitle} (共${res.total}篇)`);
this.result = res;
this.hasNext = res.hasNext;
if (this.isLoadMore) {
this.dataList = this.dataList.concat(res.items);
} else {