by pritambarhate · 6y ago · 0 comments
You can still do
// Child
myFunc() {
this.$emit('thing-happened', {});
}
// Parent
<child-component @thing-happened="reactToThing" />
They are even adding the ability for the child to define what types of events they emit (I'm super excited for the autocomplete possibilities for this and how people implement it in TS) and add validation logic to the events they define (like not emitting if the data isn't valid/in the right state).I got REALLY worried/confused when I saw the parent's comment because I was so confused at how to alert the parent of something in the child but it looks like everything is fine.
This page sums it all up well: https://v3.vuejs.org/guide/migration/events-api.html#overvie...