mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-10 15:18:46 +08:00
fix:mobile scroll to more
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user