1 |
- import{aB as q,c4 as w,bq as p,aM as x,aC as B,d as m,aD as F,r as G,K as o,bt as M,bG as A,L as C,o as c,c as v,au as f,a as l,v as y,w as D,M as K,aU as L,aE as N,Z as P,aF as U,aG as V,__tla as Z}from"./index-e3afde76.js";let _,$=Promise.all([(()=>{try{return Z}catch{}})()]).then(async()=>{const d=q({size:{type:[Number,String],values:w,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"}}),S={error:s=>s instanceof Event},g=["src","alt","srcset"],h=m({name:"ElAvatar"});_=V(U(m({...h,props:d,emits:S,setup(s,{emit:b}){const t=s,e=F("avatar"),n=G(!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}),E=o(()=>{const{size:a}=t;return p(a)?e.cssVarBlock({size:A(a)||""}):void 0}),z=o(()=>({objectFit:t.fit}));function j(a){n.value=!0,b("error",a)}return C(()=>t.src,()=>n.value=!1),(a,i)=>(c(),v("span",{class:P(l(k)),style:f(l(E))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),y(l(L),{key:1},{default:D(()=>[(c(),y(K(a.icon)))]),_:1})):N(a.$slots,"default",{key:2}):(c(),v("img",{key:0,src:a.src,alt:a.alt,srcset:a.srcSet,style:f(l(z)),onError:j},null,44,g))],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/avatar/src/avatar.vue"]]))});export{_ as E,$ as __tla};
|