2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
"use strict";var e=Object.defineProperty,r=Object.defineProperties,o=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,a=(r,o,t)=>o in r?e(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t;const n=require("../../../../common/vendor.js"),d=n.defineComponent((c=((e,r)=>{for(var o in r||(r={}))i.call(r,o)&&a(e,o,r[o]);if(t)for(var o of t(r))s.call(r,o)&&a(e,o,r[o]);return e})({},{name:"wd-img",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}}),l={props:n.imgProps,emits:["error","click","load"],setup(e,{emit:r}){const o=e,t=r,i=n.computed((()=>{const e={};return n.isDef(o.height)&&(e.height=n.addUnit(o.height)),n.isDef(o.width)&&(e.width=n.addUnit(o.width)),n.isDef(o.radius)&&(e["border-radius"]=n.addUnit(o.radius),e.overflow="hidden"),`${n.objToStyle(e)};${o.customStyle}`})),s=n.computed((()=>`wd-img ${o.round?"is-round":""} ${o.customClass}`)),a=n.ref("loading");function d(e){a.value="error",t("error",e)}function c(){o.enablePreview&&o.src&&n.index.previewImage({urls:[o.src]}),t("click")}function l(e){a.value="success",t("load",e)}return(e,r)=>n.e({a:n.n(`wd-img__image ${e.customImage}`),b:n.s("success"!==a.value?"width: 0;height: 0;":""),c:e.src,d:e.mode,e:e.lazyLoad,f:n.o(l),g:n.o(d),h:"loading"===a.value},(a.value,{}),{i:"error"===a.value},(a.value,{}),{j:n.n(s.value),k:n.o(c),l:n.s(i.value)})}},r(c,o(l))));var c,l;const u=n._export_sfc(d,[["__scopeId","data-v-7065089d"]]);wx.createComponent(u);
|