From: Evan You Date: Mon, 13 Apr 2020 14:06:41 +0000 (-0400) Subject: refactor: make sure setupContext.emit always reference current emit on instance X-Git-Tag: v3.0.0-alpha.13~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5968cff3a8acc82657cd051c504265835eaac7a2;p=thirdparty%2Fvuejs%2Fcore.git refactor: make sure setupContext.emit always reference current emit on instance This is dev only and for internal use by vue-test-utils. --- diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index e9d34da54b..50c4496612 100644 --- a/packages/runtime-core/src/component.ts +++ b/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 {