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

    Adding a store (vuex) later

    Help
    3
    3
    3024
    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.
    • Hawkeye64
      Hawkeye64 last edited by Hawkeye64

      With the Quasar CLI, I originally didn’t add Vuex. Now, I would like to. I used the CLI to create a new store and have done everything according to http://quasar-framework.org/guide/app-vuex-store.html but when I try to access the store via this.$store I get an ‘undefined’ error for store.
      When the store exports “export default store” what is reading this file? Normally, you would do this where Vue instance is created. Am I missing something?

      1 Reply Last reply Reply Quote 1
      • rstoenescu
        rstoenescu Admin last edited by

        The CLI checks if you have the store folder and its index.js and reads it. If you want to add it later, just “quasar init” a new project and copy-paste the store folder from it. Obviously, adapt it to your needs.

        1 Reply Last reply Reply Quote 0
        • E
          Evan last edited by

          I had the same error, I just had to restart the dev server so it would acknowledge the freshly created store folder.

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