fix(runtime-core): should not track dynamic children when the user calls a compiled slot inside template expression (#3554)
fix #3548, partial fix for #3569
This commit is contained in:
@@ -37,6 +37,7 @@ import {
|
||||
import { resolveFilter } from '../helpers/resolveAssets'
|
||||
import { resolveMergedOptions } from '../componentOptions'
|
||||
import { InternalSlots, Slots } from '../componentSlots'
|
||||
import { ContextualRenderFn } from '../componentRenderContext'
|
||||
|
||||
export type LegacyPublicInstance = ComponentPublicInstance &
|
||||
LegacyPublicProperties
|
||||
@@ -106,7 +107,7 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
|
||||
const res: InternalSlots = {}
|
||||
for (const key in i.slots) {
|
||||
const fn = i.slots[key]!
|
||||
if (!(fn as any)._nonScoped) {
|
||||
if (!(fn as ContextualRenderFn)._ns /* non-scoped slot */) {
|
||||
res[key] = fn
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ function convertLegacySlots(vnode: VNode): VNode {
|
||||
for (const key in slots) {
|
||||
const slotChildren = slots[key]
|
||||
slots[key] = () => slotChildren
|
||||
slots[key]._nonScoped = true
|
||||
slots[key]._ns = true /* non-scoped slot */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user