0👍
Assuming that 2 of those components are not related to each other (not parent-child relation etc), you will have to use a state management like an user has stated.
And since you are using vue2, you have to use vuex
A common example of a state management
usage is shopping cart on E-commerce websites.
For example I went to Shop A, add XYZ product on my shopping cart, then go to Shop B, add LMN product to my shopping cart. When i view the cart, it will contain both XYZ product and LMN product. That’s thanks to state management
like vuex
provides.
Read the docs for further information of how this works because it require setup.
I hope this helps!
- [Vuejs]-How to order object in v-for to stay on top Vue 2
- [Vuejs]-Dynamic prop component not working in Vue 3
Source:stackexchange.com