1 |
- import{aD as x,bK as w,bk as p,bJ as F,aE as P,d as m,aF as q,r as A,e as o,bp as B,c2 as D,O as G,o as c,c as v,ax as f,a as l,j as y,w as H,P as I,aP as J,aG as K,a0 as N,aH as O,aI as V,__tla as $}from"./index-1e808f2e.js";let _,C=Promise.all([(()=>{try{return $}catch{}})()]).then(async()=>{const d=x({size:{type:[Number,String],values:w,default:"",validator:s=>p(s)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:F},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:P(String),default:"cover"}}),S={error:s=>s instanceof Event},g=["src","alt","srcset"],h=m({name:"ElAvatar"});_=V(O(m({...h,props:d,emits:S,setup(s,{emit:b}){const t=s,e=q("avatar"),n=A(!1),k=o(()=>{const{size:a,icon:i,shape:u}=t,r=[e.b()];return B(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:D(a)||""}):void 0}),z=o(()=>({objectFit:t.fit}));function j(a){n.value=!0,b("error",a)}return G(()=>t.src,()=>n.value=!1),(a,i)=>(c(),v("span",{class:N(l(k)),style:f(l(E))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),y(l(J),{key:1},{default:H(()=>[(c(),y(I(a.icon)))]),_:1})):K(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,C as __tla};
|