-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Type mismatch between :key & v-for index #3547
Comments
I think this is about Volar and |
I can't reproduce this locally and your file download link doesn't seem to work (stuck at downloading) Just pasting the content of the file directly here would be easier... |
@yyx990803 |
Duplicate of #2633 |
Sorry guys, I tried to reproduce with typescript in the proposed repro tools without success. Issue is indeed #2633 |
Version
3.0.11
Reproduction link
https://gofile.io/d/RgpasT
Steps to reproduce
Every project using typescript & having a v-for
Reproduction is just a dummy ts component with a v-for. Using it in VSCode with Volar will display the error
What is expected?
V-for "index" arg type is defined as:
const index: string | number | symbol
What is actually happening?
"Key" prop type is defined as:
(property) key?: string | number | undefined
As you can see, it is missing symbol coverage, producing type errors if we don't manually toString() or parseInt() the index in the template
The text was updated successfully, but these errors were encountered: