Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find name '$close' vs-code #3

Closed
lomonoshka opened this issue Mar 16, 2022 · 4 comments
Closed

Cannot find name '$close' vs-code #3

lomonoshka opened this issue Mar 16, 2022 · 4 comments

Comments

@lomonoshka
Copy link

Everything works great, but vs-code tells me that it can't find function $close. From where should I find it's declaration? Or maybe there is some workaround to just hide the error?

@rlemaigre
Copy link
Owner

Hello, it's declared here. When you install the plugin, it creates that global function and makes it available in all components. I'm not sure that VSCode can pick that up :-/

@rlemaigre
Copy link
Owner

Actually $close could be a plain JS function rather than a member function of components introduced by a plugin...since you have to pass this anyway...I don't know why I did it this way. I must look into this.

@smitt04
Copy link

smitt04 commented Apr 6, 2022

It would be nice as a function that could be imported from the library, but something like this will get you by if placed in a .d.ts file

declare module "@vue/runtime-core" {
  interface ComponentCustomProperties {
    $close: (comp?: Component, fallback?: any) => void;
  }
}

@rlemaigre
Copy link
Owner

$close has been deprecated, please use closeDialog now, see docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants