SEmpty.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { getCurrentInstance as d, ref as l, onMounted as _, openBlock as o, createElementBlock as s, createVNode as m, withCtx as f, renderSlot as y, toDisplayString as E } from "vue";
  2. import { Empty as a } from "ant-design-vue";
  3. import { n as g, ai as S } from "./index2.js";
  4. const v = { class: "s-empty-common" }, I = {
  5. key: 0,
  6. class: "description"
  7. }, h = {
  8. key: 1,
  9. class: "description"
  10. }, x = {
  11. __name: "SEmpty",
  12. props: {
  13. /**
  14. * icon类型
  15. * @type
  16. */
  17. type: {
  18. type: [String, Number],
  19. default: 1
  20. },
  21. /**
  22. * 提示信息
  23. * @icon
  24. */
  25. icon: {
  26. type: [String, Object],
  27. default: ""
  28. },
  29. /**
  30. * 描述信息
  31. * @desc
  32. */
  33. desc: {
  34. type: [String, Boolean],
  35. default() {
  36. }
  37. },
  38. /**
  39. * 图片样式
  40. * @desc
  41. */
  42. iconStyle: {
  43. type: Object,
  44. default() {
  45. return {};
  46. }
  47. }
  48. },
  49. setup(i) {
  50. const r = d(), { $l: c } = r.appContext.config.globalProperties, e = i, t = l(""), n = l("");
  51. return _(() => {
  52. e.icon ? t.value = e.icon : parseInt(e.type) === 1 ? t.value = a.PRESENTED_IMAGE_DEFAULT : parseInt(e.type) === 2 ? t.value = a.PRESENTED_IMAGE_SIMPLE : (t.value = a.PRESENTED_IMAGE_DEFAULT, console.warn(
  53. '内置type类型为:1 或者 2,如需其他类型,请使用icon属性,例如:icon="https://xxx.png'
  54. )), e.desc === void 0 ? n.value = c("暂无数据") : typeof e.desc == "string" ? n.value = e.desc.trim() : n.value = c("暂无数据");
  55. }), (p, D) => {
  56. const u = S;
  57. return o(), s("div", v, [
  58. m(u, {
  59. image: t.value,
  60. imageStyle: i.iconStyle
  61. }, {
  62. description: f(() => [
  63. p.$slots.default ? (o(), s("span", I, [
  64. y(p.$slots, "default", {}, void 0, !0)
  65. ])) : (o(), s("span", h, E(n.value), 1))
  66. ]),
  67. _: 3
  68. }, 8, ["image", "imageStyle"])
  69. ]);
  70. };
  71. }
  72. }, N = /* @__PURE__ */ g(x, [["__scopeId", "data-v-94e980b8"]]);
  73. export {
  74. N as default
  75. };