-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
What problem does this feature solve?
When I using "v-for" to render an list, every "instance" in the list has an "id",
I would like to use a symbol type to express my "id" , and fill my "id" into ":key".
Every thing is OK until my "id" has duplicate(Example: push same "instance" into list twice by mistake)
In function "checkDuplicateKeys", when Vue detected duplicate key, it will log a warning, the warnning code is :
"warn(
("Duplicate keys detected: '" key "'. This may cause an update error."),
vnode.context
);"
When the file "key" is symbol type, the browser will throw an error because jointing a symbol value with string, and then byebye my application.
I check the document, It didn't tell us that we can use an symbol into key, so I think it is not a bug.
So, could you please support symbol type in list rendering?
What does the proposed API look like?
- {{item.content}}
Metadata
Metadata
Assignees
Labels
No labels