186dc548e0eee85dbd8234aff5ebe0336186a95b5bede634db978584ef84606f4575a8a2c8aff637f7f6f52f8f09072f48bbfe4a3c9b0cc78d82da89bf60d3 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { defineComponent, computed, openBlock, createElementBlock, mergeProps, unref, renderSlot } from 'vue';
  2. import { iconProps } from './icon.mjs';
  3. import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
  4. import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
  5. import { isUndefined } from '../../../utils/types.mjs';
  6. import { addUnit } from '../../../utils/dom/style.mjs';
  7. const __default__ = defineComponent({
  8. name: "ElIcon",
  9. inheritAttrs: false
  10. });
  11. const _sfc_main = /* @__PURE__ */ defineComponent({
  12. ...__default__,
  13. props: iconProps,
  14. setup(__props) {
  15. const props = __props;
  16. const ns = useNamespace("icon");
  17. const style = computed(() => {
  18. const { size, color } = props;
  19. if (!size && !color)
  20. return {};
  21. return {
  22. fontSize: isUndefined(size) ? void 0 : addUnit(size),
  23. "--color": color
  24. };
  25. });
  26. return (_ctx, _cache) => {
  27. return openBlock(), createElementBlock("i", mergeProps({
  28. class: unref(ns).b(),
  29. style: unref(style)
  30. }, _ctx.$attrs), [
  31. renderSlot(_ctx.$slots, "default")
  32. ], 16);
  33. };
  34. }
  35. });
  36. var Icon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "icon.vue"]]);
  37. export { Icon as default };
  38. //# sourceMappingURL=icon2.mjs.map