From 172b7f5cf780cdfd135ee3a78965e92894bc5120 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 3 Oct 2018 11:57:47 -0400 Subject: [PATCH] fix: $emit should check for raw parent data for listeners --- packages/core/src/component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/component.ts b/packages/core/src/component.ts index a6f14cb0..d8ff5ebd 100644 --- a/packages/core/src/component.ts +++ b/packages/core/src/component.ts @@ -177,8 +177,10 @@ class InternalComponent { name: string, ...payload: any[] ): MountedComponent { + const parentData = + (this.$parentVNode && this.$parentVNode.data) || EMPTY_OBJ const parentListener = - this.$props['on' + name] || this.$props['on' + name.toLowerCase()] + parentData['on' + name] || parentData['on' + name.toLowerCase()] if (parentListener) { invokeListeners(parentListener, payload) }