Skip to content

Commit

Permalink
fix(suspense): fix suspense slot inside deoptimized slot call
Browse files Browse the repository at this point in the history
fix #4556
  • Loading branch information
yyx990803 committed Sep 16, 2021
1 parent 93949ed commit 141a5e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/runtime-core/src/components/Suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
closeBlock,
currentBlock,
Comment,
createVNode
createVNode,
isBlockTreeEnabled
} from '../vnode'
import { isFunction, isArray, ShapeFlags, toNumber } from '@vue/shared'
import { ComponentInternalInstance, handleSetupResult } from '../component'
Expand Down Expand Up @@ -727,16 +728,16 @@ function normalizeSuspenseChildren(vnode: VNode) {
function normalizeSuspenseSlot(s: any) {
let block: VNode[] | null | undefined
if (isFunction(s)) {
const isCompiledSlot = s._c
if (isCompiledSlot) {
const trackBlock = isBlockTreeEnabled && s._c
if (trackBlock) {
// disableTracking: false
// allow block tracking for compiled slots
// (see ./componentRenderContext.ts)
s._d = false
openBlock()
}
s = s()
if (isCompiledSlot) {
if (trackBlock) {
s._d = true
block = currentBlock
closeBlock()
Expand Down

0 comments on commit 141a5e1

Please sign in to comment.