Step1: add the event to the child component and use the emit. As follows:
Note: in this.$emit(‘parent’,B), parent is the mediation method between parent and child.
Step2: add on to the parent component to listen for events. As shown below:
The data here is the passed value -b
Passing the value of the subcomponent through a looks like the following: