[Vuejs]-Passing parameters in $emit is undefined

0👍

Observation : In your app.vue component, I did not see any code to listen the event from the child, instead of that you declared three data properties Lucky, Dan & Admin.

First you have to understand how to listen the events passing from the child component into parent. Ways to listening the events in parent :

In script :

created() {
  this.$on('Lucky', value => {
    console.log(value);
  });
}

— OR —

In template :

v-on:Lucky="doSomething"

Leave a comment