UNPKG

@opensig/opendesign

Version:

<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>

26 lines (25 loc) 593 B
import { isFunction } from "../_utils/is.mjs"; import { useIntersectionObserver } from "../hooks/use-intersection-observer.mjs"; import "vue"; import "../_utils/global.mjs"; let io = null; let listener = () => null; const vIntersection = { beforeMount() { io = useIntersectionObserver(); }, mounted(el, binding) { if (isFunction(binding.value)) { listener = binding.value; io == null ? void 0 : io.observe(el, listener); } }, unmounted(el) { if (listener) { io == null ? void 0 : io.unobserve(el, listener); } } }; export { vIntersection };