simplesmiler / vue-focus

A reusable focus directive for reusable Vue.js components
MIT License
404 stars 40 forks source link

Make Vue plugin #4

Closed simshaun closed 8 years ago

simshaun commented 8 years ago

It'd be nice if all the directives could be made available globally by calling Vue.use(VueFocus).

https://vuejs.org/guide/plugins.html

simplesmiler commented 8 years ago

Sorry for taking so long to response. I don't really like the plugin style, because it promotes implicit dependencies and may cause conflicts. If you really want to make things global, you can use Vue.mixin:

var VueFocus = require('vue-focus');
Vue.mixin(VueFocus.mixin);