mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix: import useNuxtApp and provide types
This commit is contained in:
parent
31002ecc2d
commit
580d9bd463
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user