From 2ab8c41a1a43952fb229587a9da48d9a1214ab9e Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 27 Nov 2020 14:35:38 -0500 Subject: [PATCH] fix(slots): dynamically named slots should be keyed by name fix #2535 --- packages/runtime-core/src/helpers/renderSlot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/helpers/renderSlot.ts b/packages/runtime-core/src/helpers/renderSlot.ts index c20b8a191dc..420c4ffc102 100644 --- a/packages/runtime-core/src/helpers/renderSlot.ts +++ b/packages/runtime-core/src/helpers/renderSlot.ts @@ -47,7 +47,7 @@ export function renderSlot( const validSlotContent = slot && ensureValidVNode(slot(props)) const rendered = createBlock( Fragment, - { key: props.key }, + { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && (slots as RawSlots)._ === SlotFlags.STABLE ? PatchFlags.STABLE_FRAGMENT