UNPKG

portalis-component

Version:

Component Library for Nuxt 3 using TailwindCSS

10 lines (9 loc) 335 B
import { useEventListener } from "@vueuse/core"; export function onScrollBottom(element, handler) { useEventListener(element, "scroll", (event) => { const target = event.target; const isBottom = target.scrollTop + target.offsetHeight >= target.scrollHeight; if (isBottom) handler(event); }, { passive: true }); }