From e308ad99e9f5bdfb0910a2d6959e746f558714c5 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 9 Feb 2020 21:47:16 -0500 Subject: [PATCH] refactor: ensure setup context.emit always point to intenral emit --- packages/runtime-core/src/component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index a615e8fa..3081ecad 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -493,7 +493,9 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext { // need to expose them through a proxy attrs: new Proxy(instance, SetupProxyHandlers.attrs), slots: new Proxy(instance, SetupProxyHandlers.slots), - emit: instance.emit + get emit() { + return instance.emit + } } return __DEV__ ? Object.freeze(context) : context }