close

How to call a function on child component on parent events

Hello Guys, How are you all? Hope You all Are Fine. Today we are going to learn How to call a function on child component on parent events in javascript. So Here I am Explain to you all the possible methods here.

Without wasting your time, Let’s start This Article.

How to call a function on child component on parent events

  1. How to call a function on child component on parent events

    to call a function on child component on parent events If you have time, use Vuex store for watching variables (aka state) or trigger (aka dispatch) an action directly.

  2. How to call a function on child component on parent events

    to call a function on child component on parent events If you have time, use Vuex store for watching variables (aka state) or trigger (aka dispatch) an action directly.

Method 1

If you have time, use Vuex store for watching variables (aka state) or trigger (aka dispatch) an action directly.

Method 2

I think we should to have a consideration about the necessity of parent to use the child’s methods.In fact,parents needn’t to concern the method of child,but can treat the child component as a FSA(finite state machine).Parents component to control the state of child component.So the solution to watch the status change or just use the compute function is enough

Summery

It’s all About this article. Hope all method helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you? Thank You.

Leave a Comment