Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Vue js : Call a chid method from the parent component


I tried to make communicate to components with vuejs and vuex :

  1. First component is a menu
  2. Second component, inside the first, is an hamburgerButton.

In this very current case, when I click the hamburgerButton, this one is animated and the menu too. With this code, after the button click, the menu is animated with vueTransition and the hamburgerButton too. Note that i use vuex to manage a menuIsOpen state.

My problem is when i click an item of the menu, I would like fired the hamburgerButton animation.

hamburgerButtonanimation method, call animButtonHandler(), is encapsulated in a @click event. Actually i understand why it doesn't work right know, but I don't perceive how to handle this method to the click of a Parent element (item of the menu). So my question is, how can I access a method to a child component from a parent component ? Or is there an another workaround methodology to achieve this ?

parent component - menu.vue :

child component : hamburgerButton.vue :

This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Vue js : Call a chid method from the parent component


Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription