el-avatar-68c393e5.js 1.4 KB

1
  1. import{av as j,bE as q,bd as p,bJ as x,aw as A,d as m,ax as J,r as L,J as o,bj as B,bZ as F,K,o as c,c as v,at as y,a as l,q as f,w as N,L as P,aL as V,ay as Y,Y as Z,az as $,aA as C,__tla as D}from"./index-73e02845.js";let d,G=Promise.all([(()=>{try{return D}catch{}})()]).then(async()=>{const _=j({size:{type:[Number,String],values:q,default:"",validator:s=>p(s)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:x},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:A(String),default:"cover"}}),S={error:s=>s instanceof Event},b=["src","alt","srcset"],g=m({name:"ElAvatar"});d=C($(m({...g,props:_,emits:S,setup(s,{emit:h}){const t=s,e=J("avatar"),n=L(!1),k=o(()=>{const{size:a,icon:i,shape:u}=t,r=[e.b()];return B(a)&&r.push(e.m(a)),i&&r.push(e.m("icon")),u&&r.push(e.m(u)),r}),z=o(()=>{const{size:a}=t;return p(a)?e.cssVarBlock({size:F(a)||""}):void 0}),E=o(()=>({objectFit:t.fit}));function w(a){n.value=!0,h("error",a)}return K(()=>t.src,()=>n.value=!1),(a,i)=>(c(),v("span",{class:Z(l(k)),style:y(l(z))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),f(l(V),{key:1},{default:N(()=>[(c(),f(P(a.icon)))]),_:1})):Y(a.$slots,"default",{key:2}):(c(),v("img",{key:0,src:a.src,alt:a.alt,srcset:a.srcSet,style:y(l(E)),onError:w},null,44,b))],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/avatar/src/avatar.vue"]]))});export{d as E,G as __tla};