Answer the question
In order to leave comments, you need to log in
Why (with examples) use :key when rendering lists?
The documentation says the following:
When Vue updates a list of elements controlled by the v-for directive, it defaults to an "update in place" strategy. If the order of the elements of an array or object has changed, Vue will not move the DOM elements, but will simply update each element in place to display the new data at the appropriate index.
<div v-for="item in items" :key="item.id">
<!— содержимое —>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question