No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to Share State Across Components?

    Help
    data source share state
    2
    3
    192
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      r03ert0 last edited by

      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 shared data object in several components.

      Is it still possible to do this or was the idea deprecated?
      Where should I define such sourceOfTruth object so that I can share it across components?

      Thank you!

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        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

        1 Reply Last reply Reply Quote 1
        • R
          r03ert0 last edited by

          awesome! thank you! 🙏

          1 Reply Last reply Reply Quote 0
          • First post
            Last post