import{_ as a,aQ as t,b as s,d as o,p as e,w as i,H as d,i as l,o as h,f as n,k as r,e as m,y as u,F as x,t as c,v as f}from"./index-2PZN6pGH.js";const p=a({data:()=>({title:"下拉刷新 + 加载更多",data:[],loadMoreText:"加载中...",showLoadMore:!1,max:0}),onLoad(){this.initData()},onUnload(){this.max=0,this.data=[],this.loadMoreText="加载更多",this.showLoadMore=!1},onReachBottom(){console.log("onReachBottom"),this.max>40?this.loadMoreText="没有更多数据了!":(this.showLoadMore=!0,setTimeout((()=>{this.setListData()}),300))},onPullDownRefresh(){console.log("onPullDownRefresh"),this.initData()},methods:{initData(){setTimeout((()=>{this.max=0,this.data=[];let a=[];this.max+=20;for(var s=this.max-19;s<this.max+1;s++)a.push(s);this.data=this.data.concat(a),t()}),300)},setListData(){let a=[];this.max+=10;for(var t=this.max-9;t<this.max+1;t++)a.push(t);this.data=this.data.concat(a)}}},[["render",function(a,t,p,w,M,_){const D=s(o("page-head"),d),L=l;return h(),e(L,null,{default:i((()=>[n(D,{title:M.title},null,8,["title"]),n(L,{class:"uni-padding-wrap uni-common-mt"},{default:i((()=>[n(L,{style:{"font-size":"12px",color:"#666"}},{default:i((()=>[r("注：PC 不支持下拉刷新")])),_:1}),(h(!0),m(x,null,u(M.data,((a,t)=>(h(),e(L,{class:"text",key:t},{default:i((()=>[r("list - "+c(a),1)])),_:2},1024)))),128)),M.showLoadMore?(h(),e(L,{key:0,class:"uni-loadmore"},{default:i((()=>[r(c(M.loadMoreText),1)])),_:1})):f("",!0)])),_:1})])),_:1})}],["__scopeId","data-v-03dd84d2"]]);export{p as default};
