mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-08 01:17:23 +08:00
2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
import{b as W}from"./back_top-98ec2857.js";function Y(e=6){return Number(Math.random().toString().substr(3,e)+Date.now()).toString(36)}const G=["#409EFF","#67C23A","#E6A23C","#F56C6C","#909399"];function Z(e,t){return Math.floor(Math.random()*(t-e+1))+e}function q(){return G[Z(0,4)]}const X="https://www.getphotoblanket.com",J=({page:e=1,pageSize:t=20})=>{const n=`${X}/products.json?page=${e}&limit=${t}`;return fetch(n).then(o=>o.json()).then(o=>o.products).then(o=>o.map(r=>({id:Y(),star:!1,price:r.variants[0].price,src:{original:r.images[0].src},backgroundColor:q(),name:r.title})))},$="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABbFJREFUaEPtWV1sFFUUPufOLmjpD7G0nXtm11igD0Q0CpqImsiDEcGoIVEReeBBNGgkEQSjwUR4MQZ/MBr/MeFFFIkxYAR9MGr84cFijBJ9UFPD7r3TqtWWLsVuO3PM3ew20+3uzizTxpDsTSa7e+ec75zvnPtz7l2E87zhee4/NAj83xlsZKCRgZgRaAyhmAGMrV4zA5lM5sJEItGcz+dbhBDN5gGAZkRsQcTCd/Mwc0vpu+k3v5l5yHGcDUEPtdY7AeAsIp4t/5yYmCj0myefz//LzGfNY/p7enrGqjGtSEAp9ZgQYgsz07mGiJk3OY7zVklfKbULEZ88FzxE1L7vv+Q4ztPl+tMIZLPZFUKIb87FUFBHCLHQtu2+Up/WmuNi+r5/bSqVOh7EmUZAa70VAJ6PYwwRJ6SUyRKG67odzPxHHMyi7jYi2luTgOu6O5h5T1xjiLhDSvlsIAOfAcDKOLiI+KiU8pmwDGwGgFfjGCrqDhLRgkAWHmTml2PiPkBEr4URuAcA3o5pqKR+PxG9aX7M0DDaQEQHahJQSt2KiEdmiMA7RGQCUmha61jDiJlvcxznw7A5cAMzfz4TBH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MvJ9XQC/K80YshIZv2uNAOrM+bWIHKjCWGuPi8g9zDzgZesC+LJgJcYtpeOc27MCAD/taWbeYIy5i4gKzjnvnW29BLCLmfcZY54H8GoQBONRFB3vGYByuXzt2NjYeWPMJwAeTGf8rg8hIvpTKXVlHMe3AogBnNFa+1prbnQ9gIi8rbXeHsfxE0T0DhE9qZSaP526HgDACDNPW2sPicjWvr6+VcPDw3/1jAd8vJ84ceKKTCbjj1NordelT7tu98BRZt5krd0sIlNEtFcp9VLPAIjIFq31lDHmLQBPBUGwIYqiBSV3xz1gjPFlRN3MXz0ujTHf+LKbmS+rTZZdC0BEJ5VSdxYKBR0EQYGIppRSW3oGAEA1++4F8KK/ySmljvQMQDX7Wmt9ZeqP0rqXr24NoZ+Y+TpjzDoiOuvvCszM9YrFbgV4nZmfi+N4JxHtJ6JnlFJv9hLAXPY1xuQAbASwlpnrNsY67oHKlXL+RgbgAjMP5nK5/oGBgd+DIPhNKeU7F3VHxwFq80Cl/fKYMeYRAIdFZL/W+oWeAQDwMDN/7PtLADzEHcx8qmcAUtn3FxFZrbW+vNFVteMhFMexj+/7faKqxP9okiRDzrkvALzHzL5NuejoOEDasiRJJqMo+sxau19EdgZB8FAURf4auTyARgrteJZuq9SbzxhzBsBNi2XfJcvpdhjZaI5GAEmSXOOcO09EsVIqu5QtHe/M1Rpord0hIm8A2MHM/h7QcHQjQMF/P3DOXZ3NZn/teoBKJr4AYLpSPviu4HfMfPNSxvvnCzzgnNvejFKrMmEYDi/S3LWVjx37mHlXM+vUhlAzOm2RISLnu9N+slwut2pwcHCCiCZExH+5mchmsyebWWgOwBgz3+lqRqldMszsd3zByOfzt4yOjn7b7Bod/8TUrKGLyV0CaHUHW9X/D9N93V6azvezAAAAAElFTkSuQmCC";const T=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},te={},ne=e=>(Vue.pushScopeId("data-v-259be2b2"),e=e(),Vue.popScopeId(),e),oe={class:"container"},re=ne(()=>Vue.createElementVNode("div",{class:"spinner"},null,-1)),ie=[re];function se(e,t){return Vue.openBlock(),Vue.createElementBlock("div",oe,ie)}const ae=T(te,[["render",se],["__scopeId","data-v-259be2b2"],["__file","/home/oumoussa/side-projects/infinite/src/components/Spinner.vue"]]),ue=e=>({loading(){e.value="loading"},loaded(){e.value="loaded"},complete(){e.value="complete"},error(){e.value="error"}}),le=(e,t,n)=>()=>{const o=n.parentEl||document.documentElement;n.prevHeight=o.scrollHeight,t.loading(),e("infinite",t)},ce=(e,t)=>{const n=e.getBoundingClientRect();if(!t)return n.top>=0&&n.bottom<=window.innerHeight;const o=t.getBoundingClientRect();return n.top>=o.top&&n.bottom<=o.bottom},b=e=>{e.parentEl=document.querySelector(e.target)||null;let t=`0px 0px ${e.distance}px 0px`;e.top&&(t=`${e.distance}px 0px 0px 0px`);const n=new IntersectionObserver(o=>{o[0].isIntersecting&&(e.firstload&&e.emit(),e.firstload=!0)},{root:e.parentEl,rootMargin:t});return n.observe(e.infiniteLoading.value),n},de={class:"state-error"},fe={__name:"InfiniteLoading",props:{top:{type:Boolean,required:!1},target:{type:[String,Boolean],required:!1},distance:{type:Number,required:!1,default:0},identifier:{required:!1},firstload:{type:Boolean,required:!1,default:!0},slots:{type:Object,required:!1}},emits:["infinite"],setup(e,{emit:t}){const n=e;let o=null;const r=Vue.ref(null),s=Vue.ref("ready"),{top:i,firstload:a,target:c,distance:u}=n,{identifier:d}=Vue.toRefs(n),l={infiniteLoading:r,target:c,top:i,firstload:a,distance:u,prevHeight:0,parentEl:null};l.emit=le(t,ue(s),l);const m=()=>Vue.watch(s,async f=>{const g=l.parentEl||document.documentElement;await Vue.nextTick(),f=="loaded"&&i&&(g.scrollTop=g.scrollHeight-l.prevHeight),f=="loaded"&&ce(r.value,l.parentEl)&&l.emit(),f=="complete"&&o.disconnect()}),p=()=>Vue.watch(d,()=>{s.value="ready",o.disconnect(),o=b(l)});return Vue.onMounted(()=>{o=b(l),m(),d&&p()}),Vue.onUnmounted(()=>{o.disconnect()}),(f,g)=>(Vue.openBlock(),Vue.createElementBlock("div",{ref_key:"infiniteLoading",ref:r},[s.value=="loading"?Vue.renderSlot(f.$slots,"spinner",{key:0},()=>[Vue.createVNode(ae)],!0):Vue.createCommentVNode("v-if",!0),s.value=="complete"?Vue.renderSlot(f.$slots,"complete",{key:1},()=>{var h;return[Vue.createElementVNode("span",null,Vue.toDisplayString(((h=e.slots)==null?void 0:h.complete)||"No more results!"),1)]},!0):Vue.createCommentVNode("v-if",!0),s.value=="error"?Vue.renderSlot(f.$slots,"error",{key:2,retry:l.emit},()=>{var h;return[Vue.createElementVNode("span",de,[Vue.createElementVNode("span",null,Vue.toDisplayString(((h=e.slots)==null?void 0:h.error)||"Oops something went wrong!"),1),Vue.createElementVNode("button",{class:"retry",onClick:g[0]||(g[0]=(...A)=>l.emit&&l.emit(...A))}," retry ")])]},!0):Vue.createCommentVNode("v-if",!0)],512))}},me=T(fe,[["__scopeId","data-v-9d82030b"],["__file","/home/oumoussa/side-projects/infinite/src/components/InfiniteLoading.vue"]]);function pe(e){return Vue.getCurrentScope()?(Vue.onScopeDispose(e),!0):!1}const L=typeof window<"u";function ge(e,t){function n(...o){e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})}return n}function he(e,t={}){let n,o;return s=>{const i=Vue.unref(e),a=Vue.unref(t.maxWait);if(n&&clearTimeout(n),i<=0||a!==void 0&&a<=0)return o&&(clearTimeout(o),o=null),s();a&&!o&&(o=setTimeout(()=>{n&&clearTimeout(n),o=null,s()},a)),n=setTimeout(()=>{o&&clearTimeout(o),o=null,s()},i)}}function Ae(e,t=200,n={}){return ge(he(t,n),e)}function ve(e){var t;const n=Vue.unref(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ye=L?window:void 0,E=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_="__vueuse_ssr_handlers__";E[_]=E[_]||{};var S=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,be=(e,t)=>{var n={};for(var o in e)Ve.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&S)for(var o of S(e))t.indexOf(o)<0&&we.call(e,o)&&(n[o]=e[o]);return n};function Ee(e,t,n={}){const o=n,{window:r=ye}=o,s=be(o,["window"]);let i;const a=r&&"ResizeObserver"in r,c=()=>{i&&(i.disconnect(),i=void 0)},u=Vue.watch(()=>ve(e),l=>{c(),a&&r&&l&&(i=new ResizeObserver(t),i.observe(l,s))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return pe(d),{isSupported:a,stop:d}}var z,N;L&&(window!=null&&window.navigator)&&((z=window==null?void 0:window.navigator)!=null&&z.platform)&&/iP(ad|hone|od)/.test((N=window==null?void 0:window.navigator)==null?void 0:N.platform);const _e=({breakpoints:e,wrapperWidth:t,gutter:n,hasAroundGutter:o,initWidth:r})=>{const s=Object.keys(e).map(u=>Number(u)).sort((u,d)=>u-d);let i=t,a=!1;for(const u of s)if(t<=u){i=u,a=!0;break}if(!a)return r;const c=e[i].rowPerView;return o?(t-n)/c-n:(t-(c-1)*n)/c};function Se(e){const t=Vue.ref(0),n=Vue.ref(null);Ee(n,i=>{const a=i[0],{width:c}=a.contentRect;t.value=c});const o=Vue.computed(()=>_e({wrapperWidth:t.value,breakpoints:e.breakpoints,gutter:e.gutter,hasAroundGutter:e.hasAroundGutter,initWidth:e.width})),r=Vue.computed(()=>{const i=e.hasAroundGutter?-e.gutter:e.gutter;return Math.floor((t.value+i)/(o.value+e.gutter))}),s=Vue.computed(()=>{const i=e.hasAroundGutter?e.gutter:-e.gutter,a=r.value*(o.value+e.gutter)+i;return(t.value-a)/2});return{waterfallWrapper:n,wrapperWidth:t,colWidth:o,cols:r,offsetX:s}}function H(e,t){return new RegExp(`(^|\\s)${t}(\\s|$)`).test(e.className)}function O(e,t){if(H(e,t))return;const n=e.className.split(/\s+/);n.push(t),e.className=n.join(" ")}const ze=document.createElement("div").style,V=(()=>{const e={webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform",standard:"transform"};for(const t in e){const n=e[t];if(ze[n]!==void 0)return t}return!1})();function y(e){return V===!1?!1:V==="standard"?e:V+e.charAt(0).toUpperCase()+e.substr(1)}const I=y("transform"),x=y("animation-duration"),R=y("animation-delay"),B=y("transition"),C=y("animation-fill-mode");function Ne(e,t,n,o,r){const s=Vue.ref([]),i=Vue.ref(0),a=l=>{const m=e.hasAroundGutter?l+1:l;return e.gutter*m+t.value*l+o.value},c=()=>{s.value=new Array(n.value).fill(e.hasAroundGutter?e.gutter:0)},u=Oe(e);return{wrapperHeight:i,layoutHandle:async()=>{c();const l=[];if(r&&r.value&&r.value.childNodes.forEach(m=>{m.className==="waterfall-item"&&l.push(m)}),l.length===0)return!1;for(let m=0;m<l.length;m++){const p=l[m],f=Math.min.apply(null,s.value),g=s.value.indexOf(f),h=a(g),A=p.style;I&&(A[I]=`translate3d(${h}px,${f}px, 0)`),A.width=`${t.value}px`;const{height:Q}=p.getBoundingClientRect();s.value[g]+=Q+e.gutter,u(p,()=>{B&&(A[B]="transform .3s")})}i.value=Math.max.apply(null,s.value)}}}function Oe(e){return(t,n)=>{const o=t.firstChild;if(o&&!H(o,e.animationPrefix)){const r=`${e.animationDuration/1e3}s`,s=`${e.animationDelay/1e3}s`,i=o.style;i.visibility="visible",x&&(i[x]=r),R&&(i[R]=s),C&&(i[C]="both"),O(o,e.animationPrefix),O(o,e.animationEffect),n&&setTimeout(()=>{n()},e.animationDuration+e.animationDelay)}}}const Ie=typeof window<"u"&&window!==null,k=Be(),xe=Object.prototype.propertyIsEnumerable,F=Object.getOwnPropertySymbols;function Re(e,...t){return t.map(o=>o.replace(/\[(\w+)\]/g,".$1").split(".").reduce((r,s)=>r&&r[s],e))}function Be(){return Ie&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype?("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}}),!0):!1}function v(e){return typeof e=="function"||toString.call(e)==="[object Object]"}function Ce(e){return typeof e=="object"?e===null:typeof e!="function"}function ke(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function Fe(e,...t){if(!v(e))throw new TypeError("expected the first argument to be an object");if(t.length===0||typeof Symbol!="function"||typeof F!="function")return e;for(const n of t){const o=F(n);for(const r of o)xe.call(n,r)&&(e[r]=n[r])}return e}function K(e,...t){let n=0;for(Ce(e)&&(e=t[n++]),e||(e={});n<t.length;n++)if(v(t[n])){for(const o of Object.keys(t[n]))ke(o)&&(v(e[o])&&v(t[n][o])?K(e[o],t[n][o]):e[o]=t[n][o]);Fe(e,t[n])}return e}function j(e,t){return new Promise((n,o)=>{const r=new Image;r.onload=()=>{n(r)},r.onerror=()=>{o(new Error("Image load error"))},t&&(r.crossOrigin="Anonymous"),r.src=e})}const je={rootMargin:"0px",threshold:0},D="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",De="";class Me{constructor(t=!0,n,o=!0){this.lazyActive=!0,this.crossOrigin=!0,this.options={loading:D,error:De,observerOptions:je,log:!0},this._images=new WeakMap,this.lazyActive=t,this.crossOrigin=o,this.config(n)}config(t={}){K(this.options,t)}mount(t,n,o){const{src:r,loading:s,error:i}=this._valueFormatter(n);t.setAttribute("lazy","loading"),t.setAttribute("src",s||D),this.lazyActive?(k||(this._setImageSrc(t,r,o,i),this._log(()=>{throw new Error("Not support IntersectionObserver!")})),this._initIntersectionObserver(t,r,o,i)):this._setImageSrc(t,r,o,i)}resize(t,n){const o=t.getAttribute("lazy"),r=t.getAttribute("src");o&&o==="loaded"&&r&&j(r,this.crossOrigin).then(s=>{const{width:i,height:a}=s,c=t.width/i*a;t.height=c;const u=t.style;u.height=`${c}px`,n()})}unmount(t){const n=this._realObserver(t);n&&n.unobserve(t),this._images.delete(t)}_setImageSrc(t,n,o,r){!n||t.getAttribute("src")===n||j(n,this.crossOrigin).then(i=>{const{width:a,height:c}=i,u=c/a,d=t.parentNode.parentNode;d.style.paddingBottom=`${u*100}%`,t.setAttribute("lazy","loaded"),t.removeAttribute("src"),t.setAttribute("src",n),o()}).catch(()=>{const i=this._realObserver(t);i&&i.disconnect(),r&&(t.setAttribute("lazy","error"),t.setAttribute("src",r)),this._log(()=>{throw new Error(`Image failed to load!And failed src was: ${n} `)}),o()})}_isOpenLazy(){return k&&this.lazyActive}_initIntersectionObserver(t,n,o,r){const s=this.options.observerOptions;this._images.set(t,new IntersectionObserver(a=>{Array.prototype.forEach.call(a,c=>{if(c.isIntersecting){const u=this._realObserver(t);u&&u.unobserve(c.target),this._setImageSrc(t,n,o,r)}})},s));const i=this._realObserver(t);i&&i.observe(t)}_valueFormatter(t){let n=t,o=this.options.loading,r=this.options.error;return v(t)&&(n=t.src,o=t.loading||this.options.loading,r=t.error||this.options.error),{src:n,loading:o,error:r}}_log(t){this.options.log&&t()}_realObserver(t){return this._images.get(t)}}var U=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n};const w=Vue.defineComponent({props:{list:{type:Array,default:()=>[]},rowKey:{type:String,default:"id"},imgSelector:{type:String,default:"src"},width:{type:Number,default:200},breakpoints:{type:Object,default:()=>({1200:{rowPerView:3},800:{rowPerView:2},500:{rowPerView:1}})},gutter:{type:Number,default:10},hasAroundGutter:{type:Boolean,default:!0},animationPrefix:{type:String,default:"animate__animated"},animationEffect:{type:String,default:"fadeIn"},animationDuration:{type:Number,default:1e3},animationDelay:{type:Number,default:300},backgroundColor:{type:String,default:"#fff"},lazyload:{type:Boolean,default:!0},loadProps:{type:Object,default:()=>{}},crossOrigin:{type:Boolean,default:!0},delay:{type:Number,default:300}},setup(e){const t=new Me(e.lazyload,e.loadProps,e.crossOrigin);Vue.provide("lazy",t);const{waterfallWrapper:n,wrapperWidth:o,colWidth:r,cols:s,offsetX:i}=Se(e),{wrapperHeight:a,layoutHandle:c}=Ne(e,r,s,i,n),u=Ae(()=>{c()},e.delay);Vue.watch(()=>[o,r,e.list],()=>{u()},{deep:!0});const d=Vue.ref(0);return Vue.provide("sizeChangeTime",d),Vue.provide("imgLoaded",u),{waterfallWrapper:n,wrapperHeight:a,getRenderURL:p=>Re(p,e.imgSelector)[0],getKey:(p,f)=>p[e.rowKey]||f}}}),M=()=>{Vue.useCssVars(e=>({e0bdcc92:e.backgroundColor}))},P=w.setup;w.setup=P?(e,t)=>(M(),P(e,t)):M;const Pe=w,Te={class:"waterfall-card"};function Le(e,t,n,o,r,s){return Vue.openBlock(),Vue.createElementBlock("div",{ref:"waterfallWrapper",class:"waterfall-list",style:Vue.normalizeStyle({height:`${e.wrapperHeight}px`})},[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.list,(i,a)=>(Vue.openBlock(),Vue.createElementBlock("div",{key:e.getKey(i,a),class:"waterfall-item"},[Vue.createElementVNode("div",Te,[Vue.renderSlot(e.$slots,"item",{item:i,index:a,url:e.getRenderURL(i)},void 0,!0)])]))),128))],4)}var He=U(Pe,[["render",Le],["__scopeId","data-v-585fbbe9"]]);const Ke=Vue.defineComponent({props:{url:{type:String,default:""}},setup(e){const t=Vue.inject("imgLoaded"),n=Vue.inject("lazy"),o=Vue.ref(null);Vue.onMounted(()=>{r()}),Vue.onUnmounted(()=>{s()});function r(){o.value&&n.mount(o.value,e.url,()=>{t()})}function s(){o.value&&n.unmount(o.value)}return{lazyRef:o}}}),Ue={class:"lazy__box"},Qe={class:"lazy__resource"},We={ref:"lazyRef",class:"lazy__img"};function Ye(e,t,n,o,r,s){return Vue.openBlock(),Vue.createElementBlock("div",Ue,[Vue.createElementVNode("div",Qe,[Vue.createElementVNode("img",We,null,512)])])}var Ge=U(Ke,[["render",Ye],["__scopeId","data-v-5a384790"]]);const Ze=["onClick"],qe={class:"overflow-hidden"},Xe={class:"px-4 pt-2 pb-4 border-t border-t-gray-800"},Je={class:"pb-4 text-gray-50 group-hover:text-yellow-300"},$e={class:"pt-3 flex justify-between items-center border-t border-t-gray-600 border-opacity-50"},et={class:"text-gray-50"},tt=["onClick"],ot=Vue.defineComponent({__name:"index",setup(e){const t=Vue.reactive({rowKey:"id",gutter:10,hasAroundGutter:!0,width:320,breakpoints:{1200:{rowPerView:4},800:{rowPerView:3},500:{rowPerView:2}},animationEffect:"animate__zoomInUp",animationDuration:1e3,animationDelay:300,imgSelector:"src.original",loadProps:{loading:ee,error:$},lazyload:!0}),n=Vue.ref(1),o=Vue.ref([]),r=Vue.ref(),s=Vue.ref();function i(){s.value=ElementPlus.ElLoading.service({target:".content",background:"transparent",text:"加载中"}),J({page:n.value,pageSize:r.value}).then(u=>{setTimeout(()=>{o.value.push(...u),n.value+=1,Vue.nextTick(()=>{s.value.close()})},500)})}function a(u,d){o.value.splice(d,1)}function c(u){}return Vue.onMounted(()=>{i()}),(u,d)=>{const l=Vue.resolveComponent("el-backtop"),m=Vue.resolveComponent("el-scrollbar");return Vue.openBlock(),Vue.createBlock(m,{height:"87vh",class:"content"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(He),Vue.mergeProps({list:o.value},t),{item:Vue.withCtx(({item:p,url:f,index:g})=>[Vue.createElementVNode("div",{class:"bg-gray-900 rounded-lg shadow-md overflow-hidden transition-all duration-300 ease-linear hover:shadow-lg hover:shadow-gray-600 group",onClick:h=>void 0},[Vue.createElementVNode("div",qe,[Vue.createVNode(Vue.unref(Ge),{url:f,class:"cursor-pointer transition-all duration-300 ease-linear group-hover:scale-105"},null,8,["url"])]),Vue.createElementVNode("div",Xe,[Vue.createElementVNode("h4",Je,Vue.toDisplayString(p.name),1),Vue.createElementVNode("div",$e,[Vue.createElementVNode("div",et,"$ "+Vue.toDisplayString(p.price),1),Vue.createElementVNode("div",null,[Vue.createElementVNode("button",{class:"px-3 h-7 rounded-full bg-red-500 text-sm text-white shadow-lg transition-all duration-300 hover:bg-red-600",onClick:Vue.withModifiers(h=>a(p,g),["stop"])}," 删除 ",8,tt)])])])],8,Ze)]),_:1},16,["list"]),Vue.createVNode(l,{title:"回到顶部",right:35,"visibility-height":400,target:".content .el-scrollbar__wrap"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(W))]),_:1}),Vue.createVNode(Vue.unref(me),{firstload:!1,onInfinite:i})]),_:1})}}});export{ot as default};
|