Tag

v-for

0 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 10, 2024 · Frontend Development

Why Not Use :key="index" in Vue v-for? Understanding Virtual DOM and Diff Algorithm

This article explains why using :key="index" in Vue v-for loops is problematic, describes the virtual DOM compilation process, demonstrates the diff algorithm with examples, and provides best practices for key usage to improve rendering performance.

Diff AlgorithmVuefrontend
0 likes · 6 min read
Why Not Use :key="index" in Vue v-for? Understanding Virtual DOM and Diff Algorithm
php中文网 Courses
php中文网 Courses
Aug 23, 2021 · Frontend Development

Vue.js v-for key order affects transition animation and how to fix it

This article explains why using a numeric index as the key in a Vue.js v‑for loop can cause transition animations to apply only to the last element, and shows how switching the key to a unique string restores smooth, sequential animations.

Vue.jsanimationfrontend
0 likes · 4 min read
Vue.js v-for key order affects transition animation and how to fix it