Use Vue.use to register directive and option for register locally
Closed this issue · 1 comments
egoist commented
Just a question, why not use Vue.use
to register the directive globally if we really want global directive.
import infiniteScroll from 'vue-infinite-scroll'
Vue.use(infiniteScroll)
And it will be so good if we can register the directive where we actually need it:
import infiniteScroll from 'vue-infinite-scroll/directive'
new Vue({
directives: {infiniteScroll}
})
I'm willing to send a patch if you don't mind 😄
furybean commented
Good idea.
Accept two suggestion, but I think it should still use global directive when user isn't using cmd or es6 module.
Just send the pr. 😄