diff --git a/packages/nuxt/src/components/runtime/client-io-component.ts b/packages/nuxt/src/components/runtime/client-io-component.ts index d7b1e7273b..f367d8252d 100644 --- a/packages/nuxt/src/components/runtime/client-io-component.ts +++ b/packages/nuxt/src/components/runtime/client-io-component.ts @@ -1,6 +1,8 @@ import { defineComponent, onMounted, onUnmounted, ref } from 'vue' +import type { Ref } from "vue" export default defineComponent({ + emits: ['intersect'], setup (props, { emit }) { const intersectionTarget: Ref = ref(null) let observer: IntersectionObserver | null = null @@ -9,7 +11,7 @@ export default defineComponent({ entries.forEach((entry) => { if (entry.isIntersecting) { emit('intersect') - observer.unobserve(entry.target) + observer!.unobserve(entry.target) } }) }