acdr-ui/dist/build/mp-weixin/node-modules/wot-design-uni/components/wd-icon/wd-icon.js

2 lines
1.2 KiB
JavaScript

"use strict";var e=Object.defineProperty,o=Object.defineProperties,t=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,s=(o,t,r)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r;const a=require("../../../../common/vendor.js"),i=a.defineComponent((l=((e,o)=>{for(var t in o||(o={}))n.call(o,t)&&s(e,t,o[t]);if(r)for(var t of r(o))c.call(o,t)&&s(e,t,o[t]);return e})({},{name:"wd-icon",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}}),p={props:a.iconProps,emits:["click"],setup(e,{emit:o}){const t=e,r=o,n=a.ref(!1);a.watch((()=>t.name),(e=>{n.value=e.indexOf("/")>-1}),{deep:!0,immediate:!0});const c=a.computed((()=>{const e=t.classPrefix;return`${e} ${t.customClass} ${n.value?"wd-icon--image":e+"-"+t.name}`})),s=a.computed((()=>{const e={};return t.color&&(e.color=t.color),t.size&&(e["font-size"]=t.size),`${a.objToStyle(e)}; ${t.customStyle}`}));function i(e){r("click",e)}return(e,o)=>a.e({a:n.value},n.value?{b:e.name}:{},{c:a.o(i),d:a.n(c.value),e:a.s(s.value)})}},o(l,t(p))));var l,p;const u=a._export_sfc(i,[["__scopeId","data-v-b3b219ce"]]);wx.createComponent(u);