Tag

key

1 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Feb 19, 2025 · Frontend Development

Debugging and Fixing Memory Leaks in Vue2 Applications

This article walks through reproducing a memory‑leak scenario in a Vue2‑based terminal application, analyzes common leak causes, demonstrates how adding dynamic keys and patching Vue's sameVnode function resolves the issue, and shows how to ship the fix with patch‑package for production deployments.

PatchPatch-packageVue
0 likes · 9 min read
Debugging and Fixing Memory Leaks in Vue2 Applications
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 AlgorithmVirtual DOMVue
0 likes · 6 min read
Why Not Use :key="index" in Vue v-for? Understanding Virtual DOM and Diff Algorithm
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
May 23, 2024 · Frontend Development

Forcing Vue Component Re‑render to Fix Scroll Height Issues

This article explains why a scrollable table component misbehaves when its height changes, analyzes the root cause in the internal scroll wrapper, and demonstrates practical ways to force a Vue component to re‑render using v‑if, dynamic keys, and zero‑delay timers, complete with code examples.

Force UpdateVuecomponent
0 likes · 7 min read
Forcing Vue Component Re‑render to Fix Scroll Height Issues
TikTok Frontend Technology Team
TikTok Frontend Technology Team
Feb 23, 2022 · Frontend Development

Understanding Virtual DOM and Diff Algorithms in Frontend Frameworks

This article explains the concept of virtual DOM, its advantages over direct DOM manipulation, details the diff algorithm including same‑layer comparison, pointer techniques, and longest increasing subsequence optimizations in Vue2 and Vue3, and discusses key usage and performance considerations.

Diff AlgorithmPerformanceVirtual DOM
0 likes · 23 min read
Understanding Virtual DOM and Diff Algorithms in Frontend Frameworks
政采云技术
政采云技术
Nov 2, 2021 · Frontend Development

Why Using Index as Key in Vue Is Discouraged

Using an array index as the key in Vue list rendering can cause unnecessary DOM re‑creation, performance degradation, and data misalignment, especially when items are inserted, removed, or reordered, so developers should prefer stable, unique identifiers such as IDs, symbols, or UUIDs for keys.

Diff AlgorithmPerformanceVue
0 likes · 17 min read
Why Using Index as Key in Vue Is Discouraged
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 23, 2021 · Frontend Development

Understanding Virtual DOM and Diff Algorithm in Vue.js (Vue2 and Vue3)

This article explains the concept of virtual DOM, its structure, and how Vue's diff (patch) algorithm works, including detailed code walkthroughs, optimization strategies, key usage, and differences between Vue2 and Vue3 implementations, helping readers fully grasp the underlying principles and performance improvements.

Diff AlgorithmPatchVirtual DOM
0 likes · 28 min read
Understanding Virtual DOM and Diff Algorithm in Vue.js (Vue2 and Vue3)
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