[Vuejs]-Vue parent component get response from child method

5👍

Your problem could be solved using refs and it works as follows:
In parent component:

 <parent @click="clickHandler">
    <child ref="child" />
 </parent>

In your parent script tag:

methods: {
   async clickHandler(){
      //call child component's method using reference given in parent component
         await this.$refs.child.child_method_name();
      // rest of your parent code here
   }
}

Leave a comment