Explorar el Código

fix(runtime-core): ensure raw slot function is only normalized once (#5358)

fix: #5343
Thorsten Lünborg hace 4 años
padre
commit
e4dffe900a
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      packages/runtime-core/src/componentSlots.ts

+ 4 - 0
packages/runtime-core/src/componentSlots.ts

@@ -63,6 +63,10 @@ const normalizeSlot = (
   rawSlot: Function,
   ctx: ComponentInternalInstance | null | undefined
 ): Slot => {
+  if ((rawSlot as any)._n) {
+    // already normalized - #5353
+    return rawSlot as Slot
+  }
   const normalized = withCtx((...args: any[]) => {
     if (__DEV__ && currentInstance) {
       warn(