el-avatar-d6d93c05.js 1.4 KB

1
  1. import{b2 as w,bd as q,be as p,b3 as x,b8 as A,d as b,b4 as B,r as F,b as o,bf as J,bg as N,aS as P,o as c,c as m,av as v,a as l,l as f,w as Q,aQ as V,b5 as W,aJ as $,W as C,b6 as D,b7 as G,__tla as H}from"./index-af173888.js";let y,I=Promise.all([(()=>{try{return H}catch{}})()]).then(async()=>{const _=w({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"}}),d={error:s=>s instanceof Event},S=["src","alt","srcset"],g=b({name:"ElAvatar"});y=G(D(b({...g,props:_,emits:d,setup(s,{emit:h}){const t=s,e=B("avatar"),n=F(!1),k=o(()=>{const{size:a,icon:i,shape:u}=t,r=[e.b()];return J(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:N(a)||""}):void 0}),E=o(()=>({objectFit:t.fit}));function j(a){n.value=!0,h("error",a)}return P(()=>t.src,()=>n.value=!1),(a,i)=>(c(),m("span",{class:C(l(k)),style:v(l(z))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),f(l(W),{key:1},{default:Q(()=>[(c(),f(V(a.icon)))]),_:1})):$(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,I as __tla};