[Vuejs]-How to get object value from another component in vue script?

0👍

Sharing data across Vue Components.

  • Parent -> Child. To pass data from Parent to Child you can use Props,
  • Child -> Parent. To pass data from Child to Parent you can use Events with $emit('my-event'). See Listening to Child Components Events
  • Unrelated components can also share data using Event Bus with this.$root.$emit.

If using Vuex, I’d say that is the best way to share data across unrelated components.

Leave a comment