Adding a store (vuex) later
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?
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.
I had the same error, I just had to restart the dev server so it would acknowledge the freshly created