rlemaigre / vue3-promise-dialog

Dialogs meet promises in Vue 3 !
MIT License
69 stars 14 forks source link

Typescript Build Error #11

Closed stefanwuthrich closed 1 year ago

stefanwuthrich commented 1 year ago

Hi Using Typescript, with Vite 3.x, Vue 3.x I get a build error:

src/main.ts:48:10 - error TS2345: Argument of type '{ install: (app: any, options: any) => void; }' is not assignable to parameter of type 'Plugin_2<[]>'.
  Type '{ install: (app: any, options: any) => void; }' is not assignable to type '{ install: (app: App<any>) => any; }'.
    Types of property 'install' are incompatible.
      Type '(app: any, options: any) => void' is not assignable to type '(app: App<any>) => any'.

48     .use(PromiseDialog)
rlemaigre commented 1 year ago

Hello,

I haven't been using this for a some time now.

I don't think installing the plugin into your app is necessary anymore. I left this "PromiseDialog" thingie in the code for backward compatibility reasons because installing the plugin introduces a "$close" function or something in components and some people might still depend on it. But I think this is deprecated and useless now. At least I see I don't mention it in the docs anymore.

Try doing without this 48 line of yours and it should work fine.

stefanwuthrich commented 1 year ago

Thank you @rlemaigre
Yup, that works :-) Could be an idea to remove the part from the example on https://stackblitz.com/edit/vitejs-vite-nzzfdg?file=src%2Fmain.ts