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

    Proper way to load JSON data

    Help
    2
    2
    338
    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.
    • S
      smelvin last edited by

      I have created an app that has up till now used the quasar store to load (getters) data, and manipulate that data (actions/mutations). All fine and well, but I really want to access the data from a database which I have a REST api server wrapped around. This works great and I have no issues with it.
      What I am unsure of is what is the preferred or recommended way to work with the data in quasar, do I…

      1. Use the ‘store’ to retrieve the information and make it available through the ‘store’. ie. use getters/actions/mutations working with Axios to GET and PUT data.
      2. Forget about the ‘store’ all together and just load the data via Axios in the mounted section of the individual vue files.
      3. Another way???

      I am struggling to get my head around how I implement no 1. eg. I can’t import data in the getter function. Quasar says the data can only be changed in a mutation, which I know is correct. Just not sure how to go from there.

      Anyone with a similar project?

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

        I’m going to assume you don’t know the “store” is just Vuex. And, you should put most of your API calls in the Actions of your store modules.

        https://vuex.vuejs.org/ (watch the video 🙂 )

        Scott

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