mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
chore: revert for code style
This commit is contained in:
parent
068d40a283
commit
fa0bdc0e5b
@ -28,7 +28,7 @@ export function useIntersectionObserver (options?: Partial<IntersectionObserverI
|
|||||||
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0
|
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0
|
||||||
if (isVisible && callback) { callback() }
|
if (isVisible && callback) { callback() }
|
||||||
}
|
}
|
||||||
}, defu(options ?? {}, { root: null, rootMargin: '0px', threshold: 0 }))
|
}, defu(options, { root: null, rootMargin: '0px', threshold: 0 }))
|
||||||
}
|
}
|
||||||
callbacks.set(element, callback)
|
callbacks.set(element, callback)
|
||||||
observer.observe(element)
|
observer.observe(element)
|
||||||
|
@ -37,7 +37,7 @@ export const createLazyIOClientPage = (componentLoader: Component) => {
|
|||||||
|
|
||||||
if (!isIntersecting.value) {
|
if (!isIntersecting.value) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const observer = useIntersectionObserver(attrs.loader ?? {})
|
const observer = useIntersectionObserver(attrs.loader as Partial<IntersectionObserverInit> | undefined)
|
||||||
unobserve = observer!.observe(el.value as Element, () => {
|
unobserve = observer!.observe(el.value as Element, () => {
|
||||||
isIntersecting.value = true
|
isIntersecting.value = true
|
||||||
unobserve?.()
|
unobserve?.()
|
||||||
|
Loading…
Reference in New Issue
Block a user