el-avatar-42b0abb0.js 1.4 KB

1
  1. import{aK as w,b9 as A,b7 as p,bh as x,aL as F,d as m,aM as N,r as P,e as i,b8 as $,bi as q,w as B,o as c,c as v,aG as f,a as l,C as y,A as C,$ as G,aF as K,aN as L,ac as M,aO as O,aP as V,__tla as D}from"./index-a9d538d5.js";let _,H=Promise.all([(()=>{try{return D}catch{}})()]).then(async()=>{const d=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:F(String),default:"cover"}}),h={error:s=>s instanceof Event},S=["src","alt","srcset"],b=m({name:"ElAvatar"});_=V(O(m({...b,props:d,emits:h,setup(s,{emit:g}){const t=s,e=N("avatar"),n=P(!1),k=i(()=>{const{size:a,icon:o,shape:u}=t,r=[e.b()];return $(a)&&r.push(e.m(a)),o&&r.push(e.m("icon")),u&&r.push(e.m(u)),r}),z=i(()=>{const{size:a}=t;return p(a)?e.cssVarBlock({size:q(a)||""}):void 0}),E=i(()=>({objectFit:t.fit}));function j(a){n.value=!0,g("error",a)}return B(()=>t.src,()=>n.value=!1),(a,o)=>(c(),v("span",{class:M(l(k)),style:f(l(z))},[!a.src&&!a.srcSet||n.value?a.icon?(c(),y(l(K),{key:1},{default:C(()=>[(c(),y(G(a.icon)))]),_:1})):L(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};