Commit 7cef0826 by lei

1

parent c126913d
No preview for this file type
......@@ -140,28 +140,30 @@ const isFirst = ref(true);
const PopupMaxHeight = ref<number>(800);
// 搜索结果box高度
const search_list_height = ref<number>(0);
const darg = () => {
// 滚动事件
const SrcollEvent = () => {
let dom: any = document.getElementById("search-token-list");
if (dom !== null) {
dom.addEventListener("scroll", () => {
let domHeight = dom.scrollHeight;
let domTop = dom.scrollTop;
let cliheight = dom.clientHeight;
if (
domHeight - cliheight - domTop <= 20 &&
resultList.value.length >= 19
) {
// 滚动到底部
if (hasMorePages.value) {
// 如果当前加载更多已经执行,return
if (loadingMore.value) {
return;
}
loadingMore.value = true;
getTokenList();
if (dom) {
let domHeight = dom.scrollHeight;
let domTop = dom.scrollTop;
let cliheight = dom.clientHeight;
if (domHeight - cliheight - domTop <= 20 && resultList.value.length >= 19) {
// 滚动到底部
if (hasMorePages.value) {
// 如果当前加载更多已经执行,return
if (loadingMore.value) {
return;
}
loadingMore.value = true;
getTokenList();
}
});
}
}
};
const darg = () => {
let dom: any = document.getElementById("search-token-list");
if (dom) {
dom.addEventListener("scroll", SrcollEvent);
}
};
const getHeight = () => {
......@@ -194,6 +196,12 @@ onMounted(() => {
getHeight();
});
});
onBeforeUnmount(() => {
let dom: any = document.getElementById("search-token-list");
if (dom) {
dom.removeEventListener("scroll", SrcollEvent);
}
});
const onChange = (value: string) => {
keyword.value = value;
getTokenList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment