Does not setting the key cause any problems, except for the performance impact? #12611
Replies: 1 comment
-
The main purpose of a If the component instances and DOM nodes are all stateless then this likely won't cause a problem beyond the overhead of unnecessary extra updates, but if they have state then you'll end up with that state being in the wrong node. Here's an example: When removing an item from the array, Vue doesn't keep track of exactly which items were removed, it just triggers a re-render. Without a The The example also includes a transition effect with a yellow background. This is intended to show DOM 'state'. The transition doesn't work correctly without the |
Beta Was this translation helpful? Give feedback.
-
This default mode is efficient, but only suitable when your list render output does not rely on child component state or temporary DOM state (e.g. form input values).
This is the original words from the official website, but I don't understand when it will cause an error. Can you give an example?
Beta Was this translation helpful? Give feedback.
All reactions