import{d as e,h as a,X as o,l,n as r,S as s,ad as t,o as u,c as m,D as i,E as n}from"./@vue-37836d09.js";import{_ as d}from"./vue-next-wxlogin-91e03b70.js";const v=d(e({name:"AutoScroll",components:{},props:{
// 每次执行时间
time:{type:Number,default:4e3},
// 动画时间-需与样式li项即每项动画translate: height 400s ease对应
delay:{type:Number,default:400},
// 总数大于等于5项才执行动画
itemLen:{type:Number,default:5},
// 是否展示滚动条
showScrollbar:{type:Boolean,default:!1},
// 鼠标经过是否停止
mouseoverStop:{type:Boolean,default:!1},
// 加载中停止滚动
loading:{type:Boolean,default:!1}},emits:["complete"],setup(e,{emit:u}){const m=a(null),i=o({isHover:!1,datas:[],marqueeTimer:null,delayTimer:null}),n=()=>{if(i.isHover||e.loading)return;i.delayTimer&&clearTimeout(i.delayTimer);const a={...i.datas[0]};i.datas[0]._h0=!0,i.datas.push(a),i.delayTimer=setTimeout((()=>{i.datas.shift(),u("complete")}),e.delay)},d=()=>{i.delayTimer&&clearTimeout(i.delayTimer),i.marqueeTimer&&clearInterval(i.marqueeTimer)};return l((()=>{r((()=>{}))})),s((()=>{d()})),{...t(i),elRef:m,mouseleave:()=>{i.isHover=!1,m.value&&(m.value.scrollTop=0)},mouseover:()=>{e.mouseoverStop&&(i.isHover=!0)},begin:a=>{d(),a.length<e.itemLen||(i.isHover=!1,i.datas=a,i.marqueeTimer=setInterval(n,e.time))}}}}),[["render",function(e,a,o,l,r,s){return u(),m("div",{class:n(["auto-scroll scroll-black",{"auto-scroll-bar":e.showScrollbar&&e.isHover}]),ref:"elRef",onMouseleave:a[0]||(a[0]=(...a)=>e.mouseleave&&e.mouseleave(...a)),onMouseover:a[1]||(a[1]=(...a)=>e.mouseover&&e.mouseover(...a))},[i(e.$slots,"default",{},void 0,!0)],34)}],["__scopeId","data-v-5e155b02"]]);export{v as a};
//# sourceMappingURL=index-817aeea8.js.map
