Closed baradhili closed 3 years ago
outside of store I can see $gates, just inside I can't.. this is under vue v3.0.5
I solved in this way for other files, but I think it should work
import Vue from "vue";
import VueGates from 'vue-gates'
Vue.use(VueGates, {
persistent: true
});
const vueGates = Vue.prototype.$gates;
Of maybe test install Vue.use()
before your store.
I've probably just had my brain go to sleep but when trying to use
this.$gates.setRoles()
in the store (I've fetched user data inc roles and perms and want to load them) I also tried$gates.setRoles()
with the same resultI get
Uncaught (in promise) TypeError: this.$gates is undefined
I'm new to Vue in general so I've probably done something wrong :)
I do have it in my main.js