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 warning #6

Open
rubencanovaca opened this issue Sep 20, 2019 · 4 comments
Open

Import warning #6

rubencanovaca opened this issue Sep 20, 2019 · 4 comments

Comments

@rubencanovaca
Copy link

rubencanovaca commented Sep 20, 2019

I think that the export is not correct. The ES6 validation give a warning in the import.
import { longClickDirective } from 'vue-long-click'

Maybe you could declare the variable

const longClickDirective = {
    <directive here>
}

and then export it

export default longClickDirective`

or

export {
  longClickDirective
}
@rubencanovaca
Copy link
Author

incorrect import

@baffalop
Copy link

baffalop commented Dec 6, 2019

Same, I couldn't import it as recommended in the readme. I also tried the following:

import VueLongClick from 'vue-long-click'
console.log(VueLongClick)

Which results in a log of undefined. This suggests to me nothing is exported. I don't know enough about making npm packages to suggest what the issue is.

A temporary fix is to do the following:

import longClickDirective from 'vue-long-click/src/directives/longclick'

@ittus
Copy link
Owner

ittus commented Dec 23, 2019

@baffalop
You should use

import { longClickDirective } from "vue-long-click";

@rubencanovaca
I created a demo on Codesandbox, it seems ok.
https://codesandbox.io/s/gifted-firefly-q4p60?fontsize=14&hidenavigation=1&theme=dark

@notwhoyouthink1
Copy link

notwhoyouthink1 commented Sep 16, 2020

using typescript in my project so i added:
declare module 'vue-long-click';
to my shims-vue.d.ts file, im pretty sure you can just create one if you don't have one

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

4 participants