[Vuejs]-Only a single emit being received from list of child components mounted() function (Vue.js 2)

0👍

I recommend to use inject/provide to make interaction between grandparent and grandchild component

App.vue

provide(){
return {
    addComment: this.addComment
  }
},
methods:{
    addComment(){
     console.log('wow')
   }
}
// Comment.vue

inject:['addComment'],
mounted() {
   this.addComment()
 
}

Leave a comment