-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
Use v-for on an object with value and key as iterators, like in https://vuejs.org/guide/essentials/list.html#v-for-with-an-object
Then check the type of the key variable (number)
What is expected?
The key type should be string
What is actually happening?
The key type is number
System Info
No response
Any additional comments?
My guess is that it is typed as a number because v-for is usually used on an array, and in that case the second argument is the index. But v-for also supports iterating on an object and in that case it will be a string.
IanTerzo, tronytran and manuelmeister