@opensig/opendesign
Version:
31 lines (30 loc) • 906 B
JavaScript
import { defineComponent, inject, onMounted, onUnmounted, createElementBlock, openBlock, normalizeClass, unref, renderSlot } from "vue";
import { carouselInjectKey } from "./provide.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "OCarouselItem",
setup(__props) {
const injection = inject(carouselInjectKey, null);
onMounted(() => {
injection == null ? void 0 : injection.register();
});
onUnmounted(() => {
injection == null ? void 0 : injection.unregister();
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(injection) ? `o-carousel-item-${unref(injection).effect}` : "o-carousel-item"])
},
[
renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
export {
_sfc_main as default
};