You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.3 KiB

3 months ago
  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 './empty2.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=empty.mjs.map