williamcruzme / vue-gates

🔒 A Vue.js & Nuxt.js plugin that allows you to use roles and permissions in your components or DOM elements, also compatible as middleware and methods.
https://williamcruzme.github.io/vue-gates/
MIT License
263 stars 31 forks source link

Vue 3 support? #23

Closed gaetandezeiraud closed 4 years ago

gaetandezeiraud commented 4 years ago

Currently, I have the following error Uncaught TypeError: Cannot set property '$gates' of undefined. At :

var index = {
    install: function install(Vue) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var gate = new Gate(options);
      Vue.prototype.$gates = gate; // here
      Vue.gates = gate;
      registerDirectives(Vue);
    }
  };
gaetandezeiraud commented 4 years ago

A fix https://github.com/williamcruzme/vue-gates/pull/24

williamcruzme commented 4 years ago

Excellent 🥇, I'll work on that

williamcruzme commented 4 years ago

I'm having trouble getting the directive name, it turns out that binding.name doesn't exist 😢