File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
1010import { PatchFlags , SlotFlags } from '@vue/shared'
1111import { warn } from '../warning'
1212
13- export let isRenderingTemplateSlot = false
13+ export let shouldTrackInSlotRendering = 0
1414
1515/**
1616 * Compiler runtime helper for rendering `<slot/>`
@@ -39,7 +39,7 @@ export function renderSlot(
3939 // invocation interfering with template-based block tracking, but in
4040 // `renderSlot` we can be sure that it's template-based so we can force
4141 // enable it.
42- isRenderingTemplateSlot = true
42+ shouldTrackInSlotRendering ++
4343 const rendered = ( openBlock ( ) ,
4444 createBlock (
4545 Fragment ,
@@ -49,6 +49,6 @@ export function renderSlot(
4949 ? PatchFlags . STABLE_FRAGMENT
5050 : PatchFlags . BAIL
5151 ) )
52- isRenderingTemplateSlot = false
52+ shouldTrackInSlotRendering --
5353 return rendered
5454}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ import { currentRenderingInstance } from './componentRenderUtils'
3636import { RendererNode , RendererElement } from './renderer'
3737import { NULL_DYNAMIC_COMPONENT } from './helpers/resolveAssets'
3838import { hmrDirtyComponents } from './hmr'
39- import { isRenderingTemplateSlot } from './helpers/renderSlot'
39+ import { shouldTrackInSlotRendering } from './helpers/renderSlot'
4040
4141export const Fragment = ( Symbol ( __DEV__ ? 'Fragment' : undefined ) as any ) as {
4242 __isFragment : true
@@ -403,7 +403,7 @@ function _createVNode(
403403 normalizeChildren ( vnode , children )
404404
405405 if (
406- ( shouldTrack > 0 || isRenderingTemplateSlot ) &&
406+ ( shouldTrack > 0 || shouldTrackInSlotRendering > 0 ) &&
407407 // avoid a block node from tracking itself
408408 ! isBlockNode &&
409409 // has current parent block
You can’t perform that action at this time.
0 commit comments