Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import only in a Component #4

Open
Tragio opened this issue Jun 27, 2020 · 3 comments
Open

Import only in a Component #4

Tragio opened this issue Jun 27, 2020 · 3 comments

Comments

@Tragio
Copy link

Tragio commented Jun 27, 2020

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 🚀

@kn0wn
Copy link
Owner

kn0wn commented Jun 29, 2020

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
Copy link
Owner

kn0wn commented Jun 29, 2020

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
  }
}

@Tragio
Copy link
Author

Tragio commented Jun 29, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants