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

Hello, why does undefineProps return unknown when defined? #449

Open
Evllis opened this issue Jan 10, 2024 · 4 comments
Open

Hello, why does undefineProps return unknown when defined? #449

Evllis opened this issue Jan 10, 2024 · 4 comments
Assignees
Labels

Comments

@Evllis
Copy link

Evllis commented Jan 10, 2024

Library version

image

Vue.js version

image

Question

20240110_172008

20240110_171957

20240110_171936

20240110_171914

20240110_171856

I searched on Google for a long time but couldn't find a solution to the problem

Looking at the code prompt, the methods all return results, but when declaring variables, the properties are all unknown. I don't know why Can you help me, thank you.

20240110_172905

But when I use the original notation, I can access the target type, but I don't want to do this because compared to your plugin, this notation is too cumbersome

@dwightjack
Copy link
Owner

Hello, I tried to create a reproduction demo here: https://github.com/dwightjack/vitejs-vite-pktjcl. When I open the HelloWorld.vue component in VSCode I see the correct type:

image

Could you try to download it, install it (npm ci), and let me know if you see the correct typing as well?

@dwightjack dwightjack self-assigned this Jan 12, 2024
@Evllis
Copy link
Author

Evllis commented Jan 15, 2024

Okay, thank you. I'll give it a try and let you know once I have the results.

@Evllis
Copy link
Author

Evllis commented Jan 15, 2024

image

I just downloaded your demo and installed it, and I have correctly displayed the type here.

It seems that there is an issue with the configuration of my project, which affects the correct derivation of vue types.

Let me find out where the problem is.

Anyway, thank you for your help, thank you very much.

@hls-1992
Copy link

hls-1992 commented Apr 17, 2024

I have the same question
I think it was caused by the TS option 'strictNullChecks: false'
when I delete this row and restart vscode,the question is missing

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

No branches or pull requests

3 participants