ittus / vue-long-click

Long click directive library for VueJS
https://ittus.github.io/vue-long-click/
MIT License
58 stars 11 forks source link

Import warning #6

Open rubencanovaca opened 5 years ago

rubencanovaca commented 5 years ago

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 commented 5 years ago

incorrect import

baffalop commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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