Skip to content

Commit

Permalink
fix(slots): dynamically named slots should be keyed by name
Browse files Browse the repository at this point in the history
fix #2535
  • Loading branch information
yyx990803 committed Nov 27, 2020
1 parent 6e46a57 commit 2ab8c41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/helpers/renderSlot.ts
Expand Up @@ -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
Expand Down

0 comments on commit 2ab8c41

Please sign in to comment.