vue-final-modal icon indicating copy to clipboard operation
vue-final-modal copied to clipboard

Typescript error for close action inside slot

Open liyasthomas opened this issue 2 years ago • 4 comments

Version

vue-final-modal: v4.5.4 vue: v3.4.19

OS

Mac

Reproduction Link

Screenshot 2024-02-21 at 9 06 52 PM

Steps to reproduce

Inspired by #430 I tried to implement close action in the default slot but ended up getting the below typescript error:

Property 'close' does not exist on type '((props: { close: () => void; }) => void) | undefined'.ts

The close actions work fine, it's just the typescript issue persisting on usage.

What is Expected?

Close slot action should be typesafe.

What is actually happening?

Typescript compiler throwing error on usage.

liyasthomas avatar Feb 21 '24 15:02 liyasthomas

This problem still exists

Adizbek avatar Nov 19 '24 11:11 Adizbek

Just faced the same issue

mrleblanc101 avatar Jan 23 '25 17:01 mrleblanc101

Hello guys, I had the same issue until I added custom TypeScript definition in custom.d.ts file:

declare module 'vue-final-modal';

After that, the error disappeared.

eplaksin avatar May 28 '25 12:05 eplaksin