Articles
Latest
More
Newsletter Sponsorship Discord About
Sign up for our Newsletter
The video for this lesson is currently being updated, please read the transcript instead.
Build Your First Vue.js App > Lesson 11

Adding key to iterated products

When you use a v-for directive, Vue will iterate through the array and create a new DOM element for each member.

Let's say you change the array, though, while the app is running. For example, you delete one of the element. Now, Vue will need to update the DOM to reflect this change.

For the purposes of efficiency, Vue will try to identify the item it needs to remove, and simply remove that one item rather than completely re-rendering the array.


Back to course page

Click to load comments...

Articles
  • Latest
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

Vue.js Developers © 2021. View our privacy policy .

  • RSS
  • |
  • Atom