(function(t,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(t=typeof globalThis<"u"?globalThis:t||self,t.virtualScrollList=l(t.Vue))})(this,function(t){"use strict";const l={class:"virtual-scroll-list-inner"},m=t.defineComponent({__name:"VirtualScrollList",props:{sourceData:{type:Object,default:()=>[{id:"1"}]},itemHeight:{type:Number,default:()=>70}},setup(r){const c=r;t.useCssVars(e=>({f978bb38:u.value,"3cfaeabc":d.value})),t.defineComponent({name:"VirtualScrollList"});const o=t.computed(()=>c.sourceData),n=t.reactive([]),s=t.ref(),u=t.ref("0px"),d=t.ref("0px"),i=c.itemHeight;let p;const f=()=>{var h;const e=(h=s.value)==null?void 0:h.scrollTop,a=Math.floor(e/i),_=a+Math.floor(p/i);u.value=(a*i).toString()+"px",d.value=((o.value.length-_)*i).toString()+"px",n.splice(0,n.length),n.push(...o.value.slice(a,_+1))};return t.watch(()=>o.value,()=>{var e;o.value.length&&(p=(e=s.value)==null?void 0:e.clientHeight,f())}),t.onMounted(async()=>{var e;(e=s.value)==null||e.addEventListener("scroll",f)}),(e,a)=>(t.openBlock(),t.createElementBlock("div",{class:"virtual-scroll-list-outer",ref_key:"outContainer",ref:s},[t.createElementVNode("div",l,[t.renderSlot(e.$slots,"default",{viewList:n,itemHeight:t.unref(i)},void 0,!0)])],512))}}),g="";return((r,c)=>{const o=r.__vccOpts||r;for(const[n,s]of c)o[n]=s;return o})(m,[["__scopeId","data-v-d262a24c"]])});