1 |
- import{aD as q,bL as w,bl as p,bO as j,aE as F,d as m,aF as L,r as N,L as o,bq as $,c1 as A,M as B,o as c,c as v,az as y,a as l,x as f,w as D,N as G,ay as H,aG as I,$ as M,aH as O,aI as P,__tla as V}from"./index-b362e1d5.js";let _,C=Promise.all([(()=>{try{return V}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:j},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:F(String),default:"cover"}}),S={error:s=>s instanceof Event},g=["src","alt","srcset"],h=m({name:"ElAvatar"});_=P(O(m({...h,props:d,emits:S,setup(s,{emit:b}){const t=s,e=L("avatar"),n=N(!1),k=o(()=>{const{size:a,icon:i,shape:u}=t,r=[e.b()];return $(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 x(a){n.value=!0,b("error",a)}return B(()=>t.src,()=>n.value=!1),(a,i)=>(c(),v("span",{class:M(l(k)),style:y(l(z))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),f(l(H),{key:1},{default:D(()=>[(c(),f(G(a.icon)))]),_:1})):I(a.$slots,"default",{key:2}):(c(),v("img",{key:0,src:a.src,alt:a.alt,srcset:a.srcSet,style:y(l(E)),onError:x},null,44,g))],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/avatar/src/avatar.vue"]]))});export{_ as E,C as __tla};
|