]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): ensure consistent arguments for tempalte and render funtion slot...
authorEvan You <yyx990803@gmail.com>
Tue, 17 Aug 2021 15:15:53 +0000 (11:15 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 17 Aug 2021 15:15:53 +0000 (11:15 -0400)
fix #4367

packages/runtime-core/src/componentSlots.ts

index 8c19cec3fa340706ddb53ef040752e8fc044f153..ec58fd695c0692cf3a6c1b7368e7c518331e74a6 100644 (file)
@@ -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