timeline-item2.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var index$1 = require('../../icon/index.js');
  5. var timelineItem = require('./timeline-item.js');
  6. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  7. var index = require('../../../hooks/use-namespace/index.js');
  8. const __default__ = vue.defineComponent({
  9. name: "ElTimelineItem"
  10. });
  11. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  12. ...__default__,
  13. props: timelineItem.timelineItemProps,
  14. setup(__props) {
  15. const props = __props;
  16. const ns = index.useNamespace("timeline-item");
  17. const defaultNodeKls = vue.computed(() => [
  18. ns.e("node"),
  19. ns.em("node", props.size || ""),
  20. ns.em("node", props.type || ""),
  21. ns.is("hollow", props.hollow)
  22. ]);
  23. return (_ctx, _cache) => {
  24. return vue.openBlock(), vue.createElementBlock("li", {
  25. class: vue.normalizeClass([vue.unref(ns).b(), { [vue.unref(ns).e("center")]: _ctx.center }])
  26. }, [
  27. vue.createElementVNode("div", {
  28. class: vue.normalizeClass(vue.unref(ns).e("tail"))
  29. }, null, 2),
  30. !_ctx.$slots.dot ? (vue.openBlock(), vue.createElementBlock("div", {
  31. key: 0,
  32. class: vue.normalizeClass(vue.unref(defaultNodeKls)),
  33. style: vue.normalizeStyle({
  34. backgroundColor: _ctx.color
  35. })
  36. }, [
  37. _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
  38. key: 0,
  39. class: vue.normalizeClass(vue.unref(ns).e("icon"))
  40. }, {
  41. default: vue.withCtx(() => [
  42. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  43. ]),
  44. _: 1
  45. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  46. ], 6)) : vue.createCommentVNode("v-if", true),
  47. _ctx.$slots.dot ? (vue.openBlock(), vue.createElementBlock("div", {
  48. key: 1,
  49. class: vue.normalizeClass(vue.unref(ns).e("dot"))
  50. }, [
  51. vue.renderSlot(_ctx.$slots, "dot")
  52. ], 2)) : vue.createCommentVNode("v-if", true),
  53. vue.createElementVNode("div", {
  54. class: vue.normalizeClass(vue.unref(ns).e("wrapper"))
  55. }, [
  56. !_ctx.hideTimestamp && _ctx.placement === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  57. key: 0,
  58. class: vue.normalizeClass([vue.unref(ns).e("timestamp"), vue.unref(ns).is("top")])
  59. }, vue.toDisplayString(_ctx.timestamp), 3)) : vue.createCommentVNode("v-if", true),
  60. vue.createElementVNode("div", {
  61. class: vue.normalizeClass(vue.unref(ns).e("content"))
  62. }, [
  63. vue.renderSlot(_ctx.$slots, "default")
  64. ], 2),
  65. !_ctx.hideTimestamp && _ctx.placement === "bottom" ? (vue.openBlock(), vue.createElementBlock("div", {
  66. key: 1,
  67. class: vue.normalizeClass([vue.unref(ns).e("timestamp"), vue.unref(ns).is("bottom")])
  68. }, vue.toDisplayString(_ctx.timestamp), 3)) : vue.createCommentVNode("v-if", true)
  69. ], 2)
  70. ], 2);
  71. };
  72. }
  73. });
  74. var TimelineItem = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "timeline-item.vue"]]);
  75. exports["default"] = TimelineItem;
  76. //# sourceMappingURL=timeline-item2.js.map