Question · Vue.js course · Module 2: Template Syntax

The :key Attribute in v-for

Why is :key important in v-for?

Answer options

  • It is optional and unnecessary
  • Only for styling
  • For sorting elements
  • It helps Vue track element identity for performance
Show the answer

Correct answer:

  • It helps Vue track element identity for performance