import{f as e,h as s,v as l,L as o,o as n,D as a}from"./vue-c4996fb3.js";const t={class:""},r=e({__name:"ScrollLoad",props:{el:null,maxLen:null,curLen:null,hasMorePages:{type:Boolean},loadingMore:{type:Boolean}},emits:["submit"],setup(e,{emit:r}){const c=e,i=s(!0),u=()=>{const{el:e,maxLen:s,curLen:l,hasMorePages:o,loadingMore:n}=c,a=e.scrollHeight,t=e.scrollTop;if(a-e.clientHeight-t<=20&&l>s&&o){if(n)return;r("submit")}};l((()=>c.el),(e=>{e&&i.value&&(i.value=!1,m())}));const m=()=>{const{el:e,maxLen:s}=c;e&&s&&e.addEventListener("scroll",u)};return o((()=>{const{el:e}=c;e&&e.removeEventListener("scroll",u)})),(e,s)=>(n(),a("div",t))}});export{r as _};
