From 644971ec06642817cf7e720ad4980182d2140f53 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 17 Aug 2021 11:15:53 -0400 Subject: [PATCH] fix(runtime-core): ensure consistent arguments for tempalte and render funtion slot usage fix #4367 --- packages/runtime-core/src/componentSlots.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/componentSlots.ts b/packages/runtime-core/src/componentSlots.ts index 8c19cec3fa3..ec58fd695c0 100644 --- a/packages/runtime-core/src/componentSlots.ts +++ b/packages/runtime-core/src/componentSlots.ts @@ -63,7 +63,7 @@ const normalizeSlot = ( rawSlot: Function, ctx: ComponentInternalInstance | null | undefined ): Slot => { - const normalized = withCtx((props: any) => { + const normalized = withCtx((...args: any[]) => { if (__DEV__ && currentInstance) { warn( `Slot "${key}" invoked outside of the render function: ` + @@ -71,7 +71,7 @@ const normalizeSlot = ( `Invoke the slot function inside the render function instead.` ) } - return normalizeSlotValue(rawSlot(props)) + return normalizeSlotValue(rawSlot(...args)) }, ctx) as Slot // NOT a compiled slot ;(normalized as ContextualRenderFn)._c = false