Nisha Patel
Problem:
In my VueJS + Quasar project, I am trying to use useQuasar() in my store gallery.js file. But it returns undefined.
I had the same problem when accessing useRouter(), but then I found a solution. We have a router export in node_modules/quasar/wrappers/index file, so I used that to pass in my stores from main store index.js file:
My sample store file:
I tried to find quasar export also in node_modules/quasar/wrappers/index file but there is no quasar export in that file, so I don't see any way to use this.$q or $q or useQuasar() in my store file.
My usages are that I need $q.notify(), $q.platform, and $q.screen.
Is there any way to use them inside store file?
Solution:
Quasar doesn't allow the use this.$q or useQuasar outside of .vue components.
If you want to use outside component, you should use:
Source: >https://quasar.dev/options/the-q-object#outside-of-a-vue-file
Suggested blogs:
>Integrate SASS into the build and consume a UI toolkit
>Invoking Python script from scons and pass ARGLIST
>Migrate From Haruko To AWS App: 5 Simple Steps
>PHP cURL to upload video to azure blob storage
>PHP Error Solved: htaccess problem with an empty string in URL
>Plugins and Presets for Vuejs project