mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): add missing imports to <NuxtClientFallback>
(#20237)
This commit is contained in:
parent
22f1f71e3e
commit
e5d1d29b1d
@ -1,4 +1,5 @@
|
||||
import { createElementBlock, defineComponent } from 'vue'
|
||||
import { createElementBlock, defineComponent, onMounted, ref } from 'vue'
|
||||
import { useState } from '../composables/state'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'NuxtClientFallback',
|
@ -1,5 +1,6 @@
|
||||
import { defineComponent, getCurrentInstance, onErrorCaptured } from 'vue'
|
||||
import { defineComponent, getCurrentInstance, onErrorCaptured, ref } from 'vue'
|
||||
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderVNode } from 'vue/server-renderer'
|
||||
import { useState } from '../composables/state'
|
||||
import { createBuffer } from './utils'
|
||||
|
||||
const NuxtClientFallbackServer = defineComponent({
|
||||
@ -40,8 +41,8 @@ const NuxtClientFallbackServer = defineComponent({
|
||||
const defaultSlot = ctx.slots.default?.()
|
||||
const ssrVNodes = createBuffer()
|
||||
|
||||
for (let i = 0; i < defaultSlot.length; i++) {
|
||||
ssrRenderVNode(ssrVNodes.push, defaultSlot[i], vm)
|
||||
for (let i = 0; i < (defaultSlot?.length || 0); i++) {
|
||||
ssrRenderVNode(ssrVNodes.push, defaultSlot![i], vm!)
|
||||
}
|
||||
|
||||
return { ssrFailed, ssrVNodes }
|
||||
@ -52,7 +53,7 @@ const NuxtClientFallbackServer = defineComponent({
|
||||
return { ssrFailed: true, ssrVNodes: [] }
|
||||
}
|
||||
},
|
||||
ssrRender (ctx, push, parent) {
|
||||
ssrRender (ctx: any, push: any, parent: any) {
|
||||
if (ctx.ssrFailed) {
|
||||
const { fallback, placeholder } = ctx.$slots
|
||||
if (fallback || placeholder) {
|
Loading…
Reference in New Issue
Block a user