fix:mobile scroll to more

This commit is contained in:
jiangrui
2025-03-08 18:26:39 +08:00
parent 5987e1fb3e
commit 73440cca45
2 changed files with 3 additions and 2 deletions

View File

@@ -144,8 +144,8 @@ export const useResourceStore = defineStore("resource", {
if (data.length === 0) {
const list = this.resources.find((item) => item.id === channelId)?.list;
list && list[list.length - 1] && (list[list.length - 1]!.isLastMessage = true);
ElMessage.warning("没有更多了~");
}
ElMessage.warning("没有更多了~");
} else {
this.resources = data.map((item, index) => ({ ...item, displayList: index === 0 }));
if (!keyword) {
@@ -161,6 +161,7 @@ export const useResourceStore = defineStore("resource", {
}
}
} catch (error) {
console.log(error);
this.handleError("搜索失败,请重试", null);
} finally {
this.loading = false;

View File

@@ -230,7 +230,7 @@ const doScroll = () => {
const appElement = document.querySelector("#app") as HTMLElement;
if (appElement) {
const { scrollHeight, scrollTop, clientHeight } = appElement;
if (scrollHeight - (clientHeight + scrollTop) <= 0) {
if (scrollHeight - (clientHeight + scrollTop) <= 1) {
throttledLoadMore(currentTab.value);
}
}