UNPKG

hongluan-ui

Version:
39 lines (36 loc) 1.17 kB
import { defineComponent, inject, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeStyle, unref } from 'vue'; import '../../../tokens/index.mjs'; import { popperArrowProps } from './arrow.mjs'; import { POPPER_CONTENT_INJECTION_KEY } from '../../../tokens/popper.mjs'; const __default__ = defineComponent({ name: "PopperArrow", inheritAttrs: false }); const _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, props: popperArrowProps, setup(__props, { expose }) { const props = __props; const { arrowOffset, arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0); watch(() => props.arrowOffset, (val) => { arrowOffset.value = val; }); onBeforeUnmount(() => { arrowRef.value = void 0; }); expose({ arrowRef }); return (_ctx, _cache) => { return openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: arrowRef, class: "popper-arrow", style: normalizeStyle(unref(arrowStyle)), "data-popper-arrow": "" }, null, 4); }; } }); export { _sfc_main as default }; //# sourceMappingURL=arrow2.mjs.map