fix: $emit should check for raw parent data for listeners

This commit is contained in:
Evan You 2018-10-03 11:57:47 -04:00
parent 743a3c2567
commit 172b7f5cf7

View File

@ -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)
}