Files
chazhi_admin_parten/public/h5/assets/wd-img.St7DZ4lX.js
2026-03-14 16:20:49 +08:00

2 lines
2.0 KiB
JavaScript

var z=Object.defineProperty,L=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var p=(o,a,e)=>a in o?z(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e,n=(o,a)=>{for(var e in a||(a={}))I.call(a,e)&&p(o,e,a[e]);if(m)for(var e of m(a))T.call(a,e)&&p(o,e,a[e]);return o},i=(o,a)=>L(o,B(a));import{a5 as t,a4 as c,aJ as h,a6 as j,d as q,T as g,at as d,a7 as u,a8 as E,r as M,c as N,j as V,w as D,k as F,aq as f,af as v,b2 as G,aa as w,s as y,l as H,b7 as J,x as U}from"./index-B-O76M86.js";const x=i(n({},j),{customImage:h(""),src:String,previewSrc:String,round:t(!1),mode:h("scaleToFill"),lazyLoad:t(!1),width:c,height:c,radius:c,enablePreview:t(!1),showMenuByLongpress:t(!1)}),A={name:"wd-img",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}},K=q(i(n({},A),{props:x,emits:["error","click","load"],setup(o,{emit:a}){const e=o,l=a,_=g(()=>{const s={};return d(e.height)&&(s.height=u(e.height)),d(e.width)&&(s.width=u(e.width)),d(e.radius)&&(s["border-radius"]=u(e.radius),s.overflow="hidden"),`${E(s)}${e.customStyle}`}),b=g(()=>`wd-img ${e.round?"is-round":""} ${e.customClass}`),r=M("loading");function k(s){r.value="error",l("error",s)}function S(s){e.enablePreview&&e.src&&r.value=="success"&&J({urls:[e.previewSrc||e.src]}),l("click",s)}function C(s){r.value="success",l("load",s)}return(s,O)=>{const $=G,P=H;return V(),N(P,{class:y(b.value),onClick:S,style:w(_.value)},{default:D(()=>[F($,{class:y(`wd-img__image ${s.customImage}`),style:w(r.value!=="success"?"width: 0;height: 0;":""),src:s.src,mode:s.mode,"show-menu-by-longpress":s.showMenuByLongpress,"lazy-load":s.lazyLoad,onLoad:C,onError:k},null,8,["class","style","src","mode","show-menu-by-longpress","lazy-load"]),r.value==="loading"?f(s.$slots,"loading",{key:0},void 0,!0):v("",!0),r.value==="error"?f(s.$slots,"error",{key:1},void 0,!0):v("",!0)]),_:3},8,["class","style"])}}})),W=U(K,[["__scopeId","data-v-aca9eb20"]]);export{W as _};