No Type Hints
I was under the impression that Nuxt supported types everywhere. But in this simple
./app.vue
I dont get any type hints for the count variable, nor the increment function within the code block, and I do not get any errors when writing invalid typescript code before execution.
I have the Vue - Official
vs code extension installed.
If this is expected behavior, please tell me.
Thank you.Solution:Jump to solution
Restart vscode? Sometimes, for whatever reason, typescript intellisense just stops working. A simple reload usually fixes it.
8 Replies
The first issue is that
Number
is not the same as number
, the type should be number
. The second thing is that the type is automatically inferred:
you can apply custom types as well, just that in this case Number should be converted to number
also make sure your Vue extension is updated properly, VScode currently has a bug that prevents a specific older version of the Vue extension from updating to latest
Yea it gave me an error when I ran, but I didn’t get it here or the (property) Ref<number>.value: number
How do I update it properly? Just re install?
literally nothing
I am on
v2.0.28
Solution
Restart vscode? Sometimes, for whatever reason, typescript intellisense just stops working. A simple reload usually fixes it.
I swear I tried that before and it didnt work
thank you so much