kn0wn / vue-cosha

🎨 A vue directive for the cosha library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import only in a Component

Tragio opened this issue Β· comments

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.

vuecosha

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. πŸ€”