Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 418 Bytes

File metadata and controls

22 lines (16 loc) · 418 Bytes

useIntersectionObserver

Observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport.

Usage

<script setup>
import { ref } from 'vue'
import { useIntersectionObserver } from 'vue-observer-hooks'

const target = ref(null)

useIntersectionObserver(target, (entry) => {
  // todo...
})
</script>

<template>
  <div ref="target" />
</template>