Open rubencanovaca opened 5 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'
@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
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
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
and then export it
or