vue-types icon indicating copy to clipboard operation
vue-types copied to clipboard

Hello, why does undefineProps return unknown when defined?

Open Evllis opened this issue 1 year ago • 4 comments

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

Evllis avatar Jan 10 '24 09:01 Evllis

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 avatar Jan 12 '24 02:01 dwightjack

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

Evllis avatar Jan 15 '24 01:01 Evllis

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.

Evllis avatar Jan 15 '24 01:01 Evllis

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

hls-1992 avatar Apr 17 '24 08:04 hls-1992