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 o,a,i=[],t=!0,l=!1;try{for(e=e.call(r);!(t=(o=e.next()).done)&&(i.push(o.value),!n||i.length!==n);t=!0);}catch(c){l=!0,a=c}finally{try{t||null==e.return||e.return()}finally{if(l)throw a}}return i}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return n(r,e);var o=Object.prototype.toString.call(r).slice(8,-1);"Object"===o&&r.constructor&&(o=r.constructor.name);if("Map"===o||"Set"===o)return Array.from(r);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))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,o=new Array(n);e<n;e++)o[e]=r[e];return o}var e=document.createElement("style");e.innerHTML=":root{--van-image-placeholder-text-color: var(--van-text-color-2);--van-image-placeholder-font-size: var(--van-font-size-md);--van-image-placeholder-background-color: var(--van-background-color);--van-image-loading-icon-size: .85333rem;--van-image-loading-icon-color: var(--van-gray-4);--van-image-error-icon-size: .85333rem;--van-image-error-icon-color: var(--van-gray-4)}.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:var(--van-border-radius-max)}.van-image--round .van-image__img{border-radius:inherit}.van-image__img,.van-image__error,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-image-placeholder-text-color);font-size:var(--van-image-placeholder-font-size);background:var(--van-image-placeholder-background-color)}.van-image__loading-icon{color:var(--van-image-loading-icon-color);font-size:var(--van-image-loading-icon-size)}.van-image__error-icon{color:var(--van-image-error-icon-color);font-size:var(--van-image-error-icon-size)}\n",document.head.appendChild(e),System.register(["./ResizeObserver.es-legacy.9ef5ac8c.js"],(function(n){"use strict";var e,o,a,i,t,l,c,u,d,v,s,g,f,m,h,y,p,b,z,_;return{setters:[function(r){e=r.E,o=r.G,a=r.H,i=r.a0,t=r.d,l=r.U,c=r.a1,u=r.W,d=r.a2,v=r.M,s=r.a3,g=r.a4,f=r.a5,m=r.j,h=r.a6,y=r.a7,p=r.a8,b=r.X,z=r.N,_=r.O}],execute:function(){var w=r(e("image"),2),S=w[0],x=w[1],j={src:String,alt:String,fit:String,position:String,round:Boolean,width:o,height:o,radius:o,lazyLoad:Boolean,iconSize:o,showError:a,errorIcon:i("photo-fail"),iconPrefix:String,showLoading:a,loadingIcon:i("photo")},I=t({name:S,props:j,emits:["load","error"],setup:function(r,n){var e=n.emit,o=n.slots,a=l(!1),i=l(!0),t=l(),_=c().proxy.$Lazyload,w=u((function(){var n={width:d(r.width),height:d(r.height)};return v(r.radius)&&(n.overflow="hidden",n.borderRadius=d(r.radius)),n}));s((function(){return r.src}),(function(){a.value=!1,i.value=!0}));var S=function(r){i.value=!1,e("load",r)},j=function(r){a.value=!0,i.value=!1,e("error",r)},I=function(n,e,o){return o?o():m(z,{name:n,size:r.iconSize,class:e,classPrefix:r.iconPrefix},null)},L=function(){if(!a.value&&r.src){var n={alt:r.alt,class:x("img"),style:{objectFit:r.fit,objectPosition:r.position}};return r.lazyLoad?h(m("img",p({ref:t},n),null),[[y("lazy"),r.src]]):m("img",p({src:r.src,onLoad:S,onError:j},n),null)}},k=function(r){var n=r.el,e=function(){n===t.value&&i.value&&S()};t.value?e():b(e)},A=function(r){r.el!==t.value||a.value||j()};return _&&g&&(_.$on("loaded",k),_.$on("error",A),f((function(){_.$off("loaded",k),_.$off("error",A)}))),function(){var n;return m("div",{class:x({round:r.round}),style:w.value},[L(),i.value&&r.showLoading?m("div",{class:x("loading")},[I(r.loadingIcon,x("loading-icon"),o.loading)]):a.value&&r.showError?m("div",{class:x("error")},[I(r.errorIcon,x("error-icon"),o.error)]):void 0,null==(n=o.default)?void 0:n.call(o)])}}});n("I",_(I))}}}))}();
|