el-avatar-07ffa2db.js 1.4 KB

1
  1. import{aw as x,bF as A,be as p,bK as j,ax as B,d as m,ay as F,r as K,K as o,bk as M,b_ as q,L,o as c,c as v,au as y,a as l,v as f,w as N,M as P,aM as V,az as Z,Z as $,aA as C,aB as D,__tla as G}from"./index-6d7b82ba.js";let _,H=Promise.all([(()=>{try{return G}catch{}})()]).then(async()=>{const d=x({size:{type:[Number,String],values:A,default:"",validator:s=>p(s)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:j},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:B(String),default:"cover"}}),S={error:s=>s instanceof Event},b=["src","alt","srcset"],g=m({name:"ElAvatar"});_=D(C(m({...g,props:d,emits:S,setup(s,{emit:h}){const t=s,e=F("avatar"),n=K(!1),k=o(()=>{const{size:a,icon:i,shape:u}=t,r=[e.b()];return M(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:q(a)||""}):void 0}),E=o(()=>({objectFit:t.fit}));function w(a){n.value=!0,h("error",a)}return L(()=>t.src,()=>n.value=!1),(a,i)=>(c(),v("span",{class:$(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})):Z(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{_ as E,H as __tla};