el-avatar-8d3e2a75.js 1.4 KB

1
  1. import{a$ as w,ba as F,bb as p,b0 as x,b5 as N,d as b,b1 as P,r as $,b as o,bc as q,bd as A,aP as B,o as c,c as m,ar as v,a as l,l as f,w as V,aN as W,b2 as C,aF as D,W as G,b3 as H,b4 as I,__tla as J}from"./index-b2b3c6c4.js";let y,K=Promise.all([(()=>{try{return J}catch{}})()]).then(async()=>{const _=w({size:{type:[Number,String],values:F,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:N(String),default:"cover"}}),d={error:s=>s instanceof Event},S=["src","alt","srcset"],g=b({name:"ElAvatar"});y=I(H(b({...g,props:_,emits:d,setup(s,{emit:h}){const t=s,e=P("avatar"),n=$(!1),k=o(()=>{const{size:a,icon:i,shape:u}=t,r=[e.b()];return q(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:A(a)||""}):void 0}),E=o(()=>({objectFit:t.fit}));function j(a){n.value=!0,h("error",a)}return B(()=>t.src,()=>n.value=!1),(a,i)=>(c(),m("span",{class:G(l(k)),style:v(l(z))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),f(l(C),{key:1},{default:V(()=>[(c(),f(W(a.icon)))]),_:1})):D(a.$slots,"default",{key:2}):(c(),m("img",{key:0,src:a.src,alt:a.alt,srcset:a.srcSet,style:v(l(E)),onError:j},null,44,S))],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/avatar/src/avatar.vue"]]))});export{y as E,K as __tla};