]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(suspense): fix suspense slot inside deoptimized slot call
authorEvan You <yyx990803@gmail.com>
Thu, 16 Sep 2021 16:14:33 +0000 (12:14 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 16 Sep 2021 16:14:33 +0000 (12:14 -0400)
fix #4556

packages/runtime-core/src/components/Suspense.ts

index bb5ef9b3ce6f25eeb0d0352d550313aa07222c48..8408cab388d62bcd11f5ce0f20b6884fa30fb4bb 100644 (file)
@@ -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'
@@ -727,8 +728,8 @@ 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)
@@ -736,7 +737,7 @@ function normalizeSuspenseSlot(s: any) {
       openBlock()
     }
     s = s()
-    if (isCompiledSlot) {
+    if (trackBlock) {
       s._d = true
       block = currentBlock
       closeBlock()