[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2024-04-13 10:38:41 +00:00 committed by GitHub
parent e4c9940269
commit 5c300a4698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
import { createStaticVNode, defineComponent, getCurrentInstance, h, onBeforeUnmount, onMounted, ref, createVNode } from 'vue' import { createStaticVNode, createVNode, defineComponent, getCurrentInstance, h, onBeforeUnmount, onMounted, ref } from 'vue'
import type { Component, Ref, VNode } from 'vue' import type { Component, Ref, VNode } from 'vue'
// import ClientOnly from '#app/components/client-only' // import ClientOnly from '#app/components/client-only'
import { useObserver } from '#app/utils' import { useObserver } from '#app/utils'
@ -6,24 +6,22 @@ import { getFragmentHTML } from '#app/components/utils'
import { useNuxtApp } from '#app/nuxt' import { useNuxtApp } from '#app/nuxt'
// todo find a better way to do it ? // todo find a better way to do it ?
function elementIsVisibleInViewport(el: Element) { function elementIsVisibleInViewport (el: Element) {
const { top, left, bottom, right } = el.getBoundingClientRect(); const { top, left, bottom, right } = el.getBoundingClientRect()
const { innerHeight, innerWidth } = window; const { innerHeight, innerWidth } = window
return ((top > 0 && top < innerHeight) || return ((top > 0 && top < innerHeight) ||
(bottom > 0 && bottom < innerHeight)) && (bottom > 0 && bottom < innerHeight)) &&
((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth)) ((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth))
} }
/* @__NO_SIDE_EFFECTS__ */ /* @__NO_SIDE_EFFECTS__ */
export const createLazyIOClientPage = (componentLoader: Component) => { export const createLazyIOClientPage = (componentLoader: Component) => {
return defineComponent({ return defineComponent({
inheritAttrs: false, inheritAttrs: false,
setup(_, { attrs }) { setup (_, { attrs }) {
if (import.meta.server) { if (import.meta.server) {
return h('div', {}, [ return h('div', {}, [
h(componentLoader, attrs) h(componentLoader, attrs),
]) ])
} }
@ -65,7 +63,7 @@ export const createLazyIOClientPage = (componentLoader: Component) => {
export const createLazyNetworkClientPage = (componentLoader: Component) => { export const createLazyNetworkClientPage = (componentLoader: Component) => {
return defineComponent({ return defineComponent({
inheritAttrs: false, inheritAttrs: false,
setup(_, { attrs }) { setup (_, { attrs }) {
const nuxt = useNuxtApp() const nuxt = useNuxtApp()
const instance = getCurrentInstance()! const instance = getCurrentInstance()!
let vnode: VNode | null = null let vnode: VNode | null = null