SIcon.js 976 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { ref as a, watch as c, openBlock as n, createBlock as l, resolveDynamicComponent as s, normalizeStyle as m, normalizeClass as i } from "vue";
  2. import { n as u } from "./index2.js";
  3. const p = {
  4. __name: "SIcon",
  5. props: {
  6. // 图标名(antd 图标或内置业务图标)
  7. name: {
  8. type: String,
  9. required: !0
  10. },
  11. // 图标尺寸,单位 px
  12. size: {
  13. type: Number,
  14. default: 16
  15. },
  16. // 图标颜色,默认继承文字颜色
  17. color: {
  18. type: String,
  19. default: ""
  20. }
  21. },
  22. setup(e) {
  23. const r = e, o = a("var(--s-color)");
  24. return c(
  25. () => r.color,
  26. (t) => {
  27. o.value = t || "var(--s-color)";
  28. },
  29. { immediate: !0 }
  30. ), (t, f) => (n(), l(s(e.name), {
  31. class: i(e.name),
  32. style: m({ fontSize: e.size + "px", color: o.value })
  33. }, null, 8, ["class", "style"]));
  34. }
  35. }, v = /* @__PURE__ */ u(p, [["__scopeId", "data-v-440ea6b8"]]);
  36. export {
  37. v as default
  38. };