3 ms·
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: functi
by nkg 10y 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 () {})
- mixedCase 10y agoEvents 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.