fix: import useNuxtApp and provide types

This commit is contained in:
Michael Brevard 2024-04-11 00:06:49 +03:00 committed by GitHub
parent 31002ecc2d
commit 580d9bd463
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ import type { Component, Ref } from 'vue'
// import ClientOnly from '#app/components/client-only'
import { useObserver } from '#app/utils'
import { getFragmentHTML } from '#app/components/utils'
import { useNuxtApp } from '#app/nuxt'
/* @__NO_SIDE_EFFECTS__ */
export const createLazyIOClientPage = (componentLoader: Component) => {
@ -11,7 +12,7 @@ export const createLazyIOClientPage = (componentLoader: Component) => {
setup (_, { attrs }) {
const nuxt = useNuxtApp()
const instance = getCurrentInstance()!
let vnode = null
let vnode: string | null = null
if (import.meta.client && nuxt.isHydrating) {
vnode = createStaticVNode(getFragmentHTML(instance.vnode.el), 1)
}
@ -44,7 +45,7 @@ export const createLazyNetworkClientPage = (componentLoader: Component) => {
setup (_, { attrs }) {
const nuxt = useNuxtApp()
const instance = getCurrentInstance()!
let vnode = null
let vnode: string | null = null
if (import.meta.client && nuxt.isHydrating) {
vnode = createStaticVNode(getFragmentHTML(instance.vnode.el), 1)
}