Procházet zdrojové kódy

fix(runtime-core): ensure consistent arguments for tempalte and render funtion slot usage

fix #4367
Evan You před 4 roky
rodič
revize
644971ec06
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      packages/runtime-core/src/componentSlots.ts

+ 2 - 2
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