Skip to content

Commit

Permalink
add support for parent-child communication through custom events
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jul 8, 2017
1 parent 0338290 commit 6f88c83
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,17 @@
data[prop] = attrs[prop];
}

// Check for events
var eventListeners = vnode.meta.eventListeners;
if(eventListeners !== undefined) {
for(var type in eventListeners) {
var handlers = eventListeners[type];
for(var i$1 = 0; i$1 < handlers.length; i$1++) {
componentInstance.on(type, handlers[i$1]);
}
}
}

componentInstance.$slots = getSlots(vnode.children);
componentInstance.$el = node;
componentInstance.build();
Expand Down
Loading

0 comments on commit 6f88c83

Please sign in to comment.