vue-cosha icon indicating copy to clipboard operation
vue-cosha copied to clipboard

Import only in a Component

Open Tragio opened this issue 4 years ago • 3 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 🚀

Tragio avatar Jun 27 '20 10:06 Tragio

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?

kn0wn avatar Jun 29 '20 13:06 kn0wn

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 avatar Jun 29 '20 15:06 kn0wn

@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. 🤔

Tragio avatar Jun 29 '20 16:06 Tragio