mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-11 15:48:47 +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) {
|
if (data.length === 0) {
|
||||||
const list = this.resources.find((item) => item.id === channelId)?.list;
|
const list = this.resources.find((item) => item.id === channelId)?.list;
|
||||||
list && list[list.length - 1] && (list[list.length - 1]!.isLastMessage = true);
|
list && list[list.length - 1] && (list[list.length - 1]!.isLastMessage = true);
|
||||||
|
ElMessage.warning("没有更多了~");
|
||||||
}
|
}
|
||||||
ElMessage.warning("没有更多了~");
|
|
||||||
} else {
|
} else {
|
||||||
this.resources = data.map((item, index) => ({ ...item, displayList: index === 0 }));
|
this.resources = data.map((item, index) => ({ ...item, displayList: index === 0 }));
|
||||||
if (!keyword) {
|
if (!keyword) {
|
||||||
@@ -161,6 +161,7 @@ export const useResourceStore = defineStore("resource", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
this.handleError("搜索失败,请重试", null);
|
this.handleError("搜索失败,请重试", null);
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ const doScroll = () => {
|
|||||||
const appElement = document.querySelector("#app") as HTMLElement;
|
const appElement = document.querySelector("#app") as HTMLElement;
|
||||||
if (appElement) {
|
if (appElement) {
|
||||||
const { scrollHeight, scrollTop, clientHeight } = appElement;
|
const { scrollHeight, scrollTop, clientHeight } = appElement;
|
||||||
if (scrollHeight - (clientHeight + scrollTop) <= 0) {
|
if (scrollHeight - (clientHeight + scrollTop) <= 1) {
|
||||||
throttledLoadMore(currentTab.value);
|
throttledLoadMore(currentTab.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user