valgeirb / vue3-popper

A Vue.js popover component based on PopperJS
https://valgeirb.github.io/vue3-popper
MIT License
225 stars 66 forks source link

Interface props isn't exported. #67

Open juruus opened 2 years ago

juruus commented 2 years ago

Description of the bug When using the vue3-popper in a library that's going to be type defined with vue-tsc then errors occur because vue3-popper uses prop definition that isn't exported.

To Reproduce Steps to reproduce the behavior:

  1. npm i vue-tsc -D
  2. npx vue-tsc --declaration --emitDeclarationOnly
  3. See error

Expected behavior Vue3-popper should inline or export Props interface.

Screenshots This fixes it:

Screenshot 2022-06-23 at 11 42 11

So the fix to the component should be something like this:

Screenshot 2022-06-23 at 11 46 50

Links https://bytemeta.vip/repo/vuejs/docs/issues/1678 https://vuejs.org/api/sfc-script-setup.html#default-props-values-when-using-type-declaration

juruus commented 2 years ago

Outcome from vue-tsc, when my PopupMenu component wraps vue3-popper

src/components/PopupMenu/PopupMenu.vue:40:1 - error TS4082: Default export of the module has or is using private name 'Props'.

40 export default defineComponent({

mortezasabihi commented 1 year ago

I am also looking for a way to import the Props from the vue3-tooltip.

steven-twerdochlib commented 1 month ago

Any updates on this?