Skip to content

wrong v-for Map typings? #544

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

Closed
johnsoncodehk opened this issue Oct 1, 2021 Discussed in #542 · 0 comments
Closed

wrong v-for Map typings? #544

johnsoncodehk opened this issue Oct 1, 2021 Discussed in #542 · 0 comments
Labels
bug Something isn't working

Comments

@johnsoncodehk
Copy link
Member

Discussed in #542

Originally posted by j4k0xb October 1, 2021
when iterating through a map, its typically done like this:

<div v-for="[key, value] in map"

My attempt of also accessing the index:

<div v-for="([key, value], a, b) in map"

a is typed as keyof Map (all the 'clear', 'delete', etc. methods)
and b is typed as a number

but actually a is the index and b is always undefined (when printing it)
bug in volar?

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant