el-avatar-735d49bf.js 1.4 KB

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