Hacker News new | ask | show | jobs
by nkg 3495 days ago
I still wonder why they moved the events from the constructor to the instance...

Before 2.0:

new Vue({ el: "#el", data: someData, events: { myevent: function(){} } });

after 2.0 :

vm.$on('myevent', function () {})

1 comments

Events in Vue 2 are now supposed to be used only for child -> parent component communication. If your needs are more complex then you're supposed to use Vuex.