[solved] how to access $ variables from a mutation file?
-
Hey guys, I have quite a number of items I have added to my boot folder including axios, casl, lodash, vuelidate, and others, which I access via $ in my vue files.
I think I’m missing something basic, so forgive me. How do I use these items from a mutation.js file, found in my store? In my vue files, I simply do something like:
this.$axios...
or
this.$can('view', 'something')
I have tried this._vm.$can(…) but that didn’t work (nor did it throw errors).
I also didn’t know what to call this, so my search through the forums was unsuccessful. If this has been asked and answered, just let me know the search terms I should have used.
Thanks!
-
Kept looking and found the answer here: https://forum.quasar-framework.org/topic/7148/unable-to-use-this-axios-in-vuex-ts2339-property-axios-does-not-exist-on-type-store/11
I needed to a) make a function, and not use fat arrow, and b) use this._vm.$can(‘view’, loopVar)