hongluan-ui
Version:
Hongluan Component Library for Vue 3
63 lines (60 loc) • 2.47 kB
JavaScript
import { defineComponent, inject, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
import '../../../hooks/index.mjs';
import { timelineItemProps } from './timeline-item2.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const _sfc_main = defineComponent({
name: "TimelineItem",
props: timelineItemProps,
setup(props) {
const { namespace } = useNamespace("timeline-item");
const { hasIcon, props: parentProps } = inject("timeline");
props.icon && (hasIcon.value = true);
return {
namespace,
parentProps
};
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("li", {
class: normalizeClass([
_ctx.namespace,
_ctx.dir ? _ctx.dir : "",
_ctx.type ? _ctx.type : "",
_ctx.active ? "is-active" : ""
]),
style: normalizeStyle([
_ctx.color ? "--timeline-icon-color:" + _ctx.color : "",
_ctx.gap ? "--timeline-item-gap:" + _ctx.gap : ""
])
}, [
_ctx.parentProps.center || _ctx.$slots.label ? (openBlock(), createElementBlock("div", {
key: 0,
class: "item-left"
}, [
_ctx.$slots.label ? renderSlot(_ctx.$slots, "label", { key: 0 }) : createCommentVNode("v-if", true)
])) : createCommentVNode("v-if", true),
createElementVNode("div", { class: "item-center" }, [
createElementVNode("div", { class: "dot-wrap" }, [
_ctx.$slots.icon && !_ctx.color && !_ctx.$slots.dot ? renderSlot(_ctx.$slots, "icon", { key: 0 }) : (openBlock(), createElementBlock("div", {
key: 1,
class: "icon-dot"
})),
_ctx.$slots.dot ? renderSlot(_ctx.$slots, "dot", { key: 2 }) : createCommentVNode("v-if", true)
])
]),
createElementVNode("div", { class: "item-right" }, [
createElementVNode("div", { class: "item-title" }, [
renderSlot(_ctx.$slots, "default")
]),
!_ctx.hideTimestamp ? (openBlock(), createElementBlock("div", {
key: 0,
class: "item-time"
}, toDisplayString(_ctx.timestamp), 1)) : createCommentVNode("v-if", true)
])
], 6);
}
var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export { TimelineItem as default };
//# sourceMappingURL=timeline-item.mjs.map