diff --git a/packages/nuxt/src/components/runtime/client-io-component.ts b/packages/nuxt/src/components/runtime/client-io-component.ts index 081e2d82a7..d7b1e7273b 100644 --- a/packages/nuxt/src/components/runtime/client-io-component.ts +++ b/packages/nuxt/src/components/runtime/client-io-component.ts @@ -2,10 +2,10 @@ import { defineComponent, onMounted, onUnmounted, ref } from 'vue' export default defineComponent({ setup (props, { emit }) { - const intersectionTarget = ref(null) + const intersectionTarget: Ref = ref(null) let observer: IntersectionObserver | null = null - const intersectionCallback = (entries) => { + const intersectionCallback: IntersectionObserverCallback = (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { emit('intersect') @@ -16,7 +16,7 @@ export default defineComponent({ onMounted(() => { observer = new IntersectionObserver(intersectionCallback) - observer.observe(intersectionTarget.value) + observer.observe(intersectionTarget.value as Element) }) onUnmounted(() => {