[Vuejs]-How to share data between components Vue js

0πŸ‘

βœ…

If you want to share data from the parent to the child you can do:

on component A

<fileForm :something="user"></fileForm>

In component B

props: {
  something: Object
}

If you want to share data from the child to the parent you have to use an event bus or vuex: https://v2.vuejs.org/v2/guide/components.html#Non-Parent-Child-Communication

0πŸ‘

https://alligator.io/vuejs/component-communication/

You need to do some research about communication among components.

There are a lot of ways to do it πŸ˜‰

Leave a comment