1 |
- !function(){function r(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,n){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==e)return;var t,o,i=[],a=!0,l=!1;try{for(e=e.call(r);!(a=(t=e.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(u){l=!0,o=u}finally{try{a||null==e.return||e.return()}finally{if(l)throw o}}return i}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return n(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(r,n){(null==n||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}System.register(["./base-legacy.54a6af10.js"],(function(n){"use strict";var e,t,o,i,a,l,u,c,s,f,d,g,v,h,y,m,S;return{setters:[function(r){e=r.d,t=r.L,o=r.p,i=r.b1,a=r.W,l=r.u,u=r.a7,c=r.au,s=r.c,f=r.N,d=r.ae,g=r.a2,v=r.aq,h=r.aI,y=r.a0,m=r.I,S=r.O}],execute:function(){var p=r(f("image"),2),b=p[0],w=p[1],I=e({name:b,props:{src:String,alt:String,fit:String,round:Boolean,width:[Number,String],height:[Number,String],radius:[Number,String],lazyLoad:Boolean,iconSize:[Number,String],showError:t,iconPrefix:String,showLoading:t,errorIcon:{type:String,default:"photo-fail"},loadingIcon:{type:String,default:"photo"}},emits:["load","error"],setup:function(r,n){var e=n.emit,t=n.slots,f=o(!1),S=o(!0),p=o(),b=i().proxy.$Lazyload,I=a((function(){var n={};return d(r.width)&&(n.width=g(r.width)),d(r.height)&&(n.height=g(r.height)),d(r.radius)&&(n.overflow="hidden",n.borderRadius=g(r.radius)),n}));l((function(){return r.src}),(function(){f.value=!1,S.value=!0}));var z=function(r){S.value=!1,e("load",r)},x=function(r){f.value=!0,S.value=!1,e("error",r)},L=function(){if(!f.value&&r.src){var n={alt:r.alt,class:w("img"),style:{objectFit:r.fit}};return r.lazyLoad?v(s("img",y({ref:p},n),null),[[h("lazy"),r.src]]):s("img",y({src:r.src,onLoad:z,onError:x},n),null)}},A=function(r){r.el===p.value&&S.value&&z()},$=function(r){r.el!==p.value||f.value||x()};return b&&u&&(b.$on("loaded",A),b.$on("error",$),c((function(){b.$off("loaded",A),b.$off("error",$)}))),function(){return s("div",{class:w({round:r.round}),style:I.value},[L(),S.value&&r.showLoading?s("div",{class:w("loading")},[t.loading?t.loading():s(m,{size:r.iconSize,name:r.loadingIcon,class:w("loading-icon"),classPrefix:r.iconPrefix},null)]):f.value&&r.showError?s("div",{class:w("error")},[t.error?t.error():s(m,{size:r.iconSize,name:r.errorIcon,class:w("error-icon"),classPrefix:r.iconPrefix},null)]):void 0,null==t.default?void 0:t.default()])}}});n("I",S(I))}}}))}();
|