-
-
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
Warnings/Types for the key attribute #2633
Comments
And,
|
The compiled render function will enter the optimization mode when patching, it respects the so-called block-tree algorithm, which has nothing to do with the |
This PR provides the checking for duplicate keys |
Just to clarify, adding the duplicate keys warning was just one, small part of this. Primarily I was trying to get the types updated with a view to updating the docs. |
Hey guys, just want to add another reason why I believe there should be a warning for siblings with the same key: |
Version
3.0.2
Reproduction link
https://jsfiddle.net/skirtle/2czyf41n/
Steps to reproduce
The example illustrates a couple of things:
key
attribute works (this is good but undocumented).key
(value1
) for multiple adjacent siblings.What is expected?
A quick recap of Vue 2:
key
on siblings triggered a warning about duplicate keys.Observations about Vue 3:
===
. In some edge cases they are compared using aMap
. Either way, objects can now be used as keys. I think this is great.Based on my best guess about what the expected behaviour is I suggest the following changes:
key
is a great new feature and, if it's intentional, it's something worth shouting about. I'm happy to make the docs changes myself once I have confirmation of the officially supported behaviour.The text was updated successfully, but these errors were encountered: