Explorar el Código

refactor: make sure setupContext.emit always reference current emit on instance

This is dev only and for internal use by vue-test-utils.
Evan You hace 6 años
padre
commit
5968cff3a8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      packages/runtime-core/src/component.ts

+ 1 - 1
packages/runtime-core/src/component.ts

@@ -517,7 +517,7 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext {
         return new Proxy(instance.slots, slotsHandlers)
       },
       get emit() {
-        return instance.emit
+        return (event: string, ...args: any[]) => instance.emit(event, ...args)
       }
     })
   } else {