e528b51085285c48d8628dc70b0eae3b21cdc24cbd1a1e95feb451003fcef94289d0f80e3bba99bcabb369800a117314b1684845c407e191844f977f5e4723 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, renderSlot, createVNode, toDisplayString, createCommentVNode } from 'vue';
  2. import ImgEmpty from './img-empty.mjs';
  3. import { emptyProps } from './empty.mjs';
  4. import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
  5. import { useLocale } from '../../../hooks/use-locale/index.mjs';
  6. import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
  7. import { addUnit } from '../../../utils/dom/style.mjs';
  8. const __default__ = defineComponent({
  9. name: "ElEmpty"
  10. });
  11. const _sfc_main = /* @__PURE__ */ defineComponent({
  12. ...__default__,
  13. props: emptyProps,
  14. setup(__props) {
  15. const props = __props;
  16. const { t } = useLocale();
  17. const ns = useNamespace("empty");
  18. const emptyDescription = computed(() => props.description || t("el.table.emptyText"));
  19. const imageStyle = computed(() => ({
  20. width: addUnit(props.imageSize)
  21. }));
  22. return (_ctx, _cache) => {
  23. return openBlock(), createElementBlock("div", {
  24. class: normalizeClass(unref(ns).b())
  25. }, [
  26. createElementVNode("div", {
  27. class: normalizeClass(unref(ns).e("image")),
  28. style: normalizeStyle(unref(imageStyle))
  29. }, [
  30. _ctx.image ? (openBlock(), createElementBlock("img", {
  31. key: 0,
  32. src: _ctx.image,
  33. ondragstart: "return false"
  34. }, null, 8, ["src"])) : renderSlot(_ctx.$slots, "image", { key: 1 }, () => [
  35. createVNode(ImgEmpty)
  36. ])
  37. ], 6),
  38. createElementVNode("div", {
  39. class: normalizeClass(unref(ns).e("description"))
  40. }, [
  41. _ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("p", { key: 1 }, toDisplayString(unref(emptyDescription)), 1))
  42. ], 2),
  43. _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
  44. key: 0,
  45. class: normalizeClass(unref(ns).e("bottom"))
  46. }, [
  47. renderSlot(_ctx.$slots, "default")
  48. ], 2)) : createCommentVNode("v-if", true)
  49. ], 2);
  50. };
  51. }
  52. });
  53. var Empty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "empty.vue"]]);
  54. export { Empty as default };
  55. //# sourceMappingURL=empty2.mjs.map