How to Share State Across Components?
-
Hello,
I’d like to have several components, in different routes, having access to the same data. This is very much what used to be described in http://quasar-framework.org/guide/components-sharing-state.html (here’s an old version), however, that page doesn’t exist anymore.
What was proposed there was to have a single object
var sourceOfTruth = {}
used as shareddata
object in several components.Is it still possible to do this or was the idea deprecated?
Where should I define suchsourceOfTruth
object so that I can share it across components?Thank you!
-
This is the new page: https://v1.quasar-framework.org/quasar-cli/cli-documentation/vuex-store
Vuex or using a global event bus (if your app isn’t too big) is what you need.
Scott
-
awesome! thank you!