0 votes
in VueJS by
How is  data flow between components in a Vue.js app?

1 Answer

0 votes
by

Vue.js uses what’s called a one-way data flow. Data is passed to child components from a given parent component using a prop or a custom attribute that becomes a property on the child component instance.

When the parent component updates a prop value, it’s automatically updated in the child component. Mutating a property inside a child component should not be done. Also, it does not affect the parent component (unless it is an object or array).

The child component can communicate back to the parent via an event. The parent can assign a handler to any event emitted by the child component instance and data can be passed back to the parent. The child component can emit a special event for updating the props passed to it.

Related questions

0 votes
asked Oct 7, 2019 in VueJS by Tate
0 votes
asked Oct 9, 2019 in VueJS by Indian
...