SIconModal.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { ref as w, watch as C, resolveComponent as k, resolveDirective as y, openBlock as s, createBlock as n, withCtx as b, createElementVNode as c, createElementBlock as r, Fragment as g, renderList as B, unref as I, withDirectives as T, resolveDynamicComponent as x, normalizeClass as D, toDisplayString as $ } from "vue";
  2. import { l as N, aB as S } from "./index2.js";
  3. const E = {
  4. class: "icon-list",
  5. style: { height: "60vh", overflow: "hidden auto" }
  6. }, F = ["onClick"], H = { class: "name" }, M = {
  7. __name: "SIconModal",
  8. props: {
  9. value: {
  10. type: Boolean,
  11. default: !1
  12. },
  13. width: {
  14. type: Number,
  15. default: 1028
  16. }
  17. },
  18. emits: ["update:value"],
  19. setup(a, { emit: i }) {
  20. const d = ["createFromIconfontCN", "default", "getTwoToneColor", "setTwoToneColor"], u = Object.keys(S).filter((t) => !d.includes(t)), m = a, v = i, o = w(!1);
  21. C(
  22. () => m.value,
  23. (t) => {
  24. o.value = t;
  25. }
  26. );
  27. const p = () => {
  28. o.value = !1, v("update:value", !1);
  29. }, f = (t) => {
  30. window.$message.success(`<${t}/>`);
  31. };
  32. return (t, l) => {
  33. const _ = k("s-modal"), h = y("clipboard");
  34. return s(), n(_, {
  35. value: o.value,
  36. "onUpdate:value": l[0] || (l[0] = (e) => o.value = e),
  37. keyboard: "",
  38. title: "图标选择",
  39. width: a.width,
  40. onHandCancel: p
  41. }, {
  42. default: b(() => [
  43. c("div", E, [
  44. (s(!0), r(g, null, B(I(u), (e) => T((s(), r("div", {
  45. key: e,
  46. class: "item-icon",
  47. onClick: (j) => f(e)
  48. }, [
  49. (s(), n(x(e), {
  50. class: D(e)
  51. }, null, 8, ["class"])),
  52. c("div", H, $(e), 1)
  53. ], 8, F)), [
  54. [h, `<${e}/>`]
  55. ])), 128))
  56. ])
  57. ]),
  58. _: 1
  59. }, 8, ["value", "width"]);
  60. };
  61. }
  62. }, O = /* @__PURE__ */ N(M, [["__scopeId", "data-v-2d532453"]]);
  63. export {
  64. O as default
  65. };