vue-cosha
vue-cosha copied to clipboard
Import only in a Component
Hello @kn0wn 🙂!
Really thank you for your work and for contributing to the community.
I was trying to import as a local component but it's not working, not sure if I'm doing something wrong or is something with the plugin.
Thank you very much 🚀
Hi @Kulcanhez! VueCosha is a directive, therefore it has to be registered using the Vue.use
method. Is there a specific use case that you would want to import like this?
Hi @Kulcanhez, I have looked into this more and found that you can actually load the directive per component!
import VueCosha from 'vue-cosha'
export default {
directives: {
cosha: VueCosha
}
}
@kn0wn really thank you for the clarification. I'm using Cosha just in two pages, therefore I was trying to avoid to load on all other pages.
I tried that code exactly how you show but it didn't work for me. 🤔