0๐
I think the best solution is to use an application-level store, you avoid a lot of unnecessary headaches, and the readability of the application definitely improves.
you can use either https://next.vuex.vuejs.org/ or https://pinia.esm.dev/
another alternative is to use an event bus, with vue 3 it is better to use https://github.com/developit/mitt
but to use data across various components, it is always better to use the store
- [Vuejs]-Vue3 setting css styles from vuex store
- [Vuejs]-Vuex | Be able to update outside of a mutation
Source:stackexchange.com