Learn Vue 2: Part 13 - Component Communication, Example 2: Event Dispatcher

preview_player
Показать описание
The next choice you have, to allow for communication between Vue components, is creating your own event dispatcher. Don't worry: this is much easier than it sounds, due to the fact that every Vue instance already implements the necessary interface!

Рекомендации по теме
Комментарии
Автор

Very useful lesson, thanks a lot Jeff!
BTW would be great to have same situation with some data on the event firing, to show how the callback function handles it . For what I see all examples are so simple out there (alerts of simple strings) that still haven't found the way to do it :-(

rattlesnakerenegades
Автор

mine is error when i delete the methods it says undefine OnCouponApplied but i already defiened it on Vue.component methods just like you did please help me

chairulamin