Skip to content
Learn Netverks

Lesson

Step 27/36 75% through track

list-keys-detail

Lists, keys, and detail views

Last reviewed May 28, 2026 Content v20260528
Track mode
client_vue
Means
In-browser Vue TS
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Lists, keys, and detail views: the concepts, APIs, and habits you need before advancing in Vue.

Lists without stable keys break focus, animation, and state in production tables and feeds.

You will apply Lists, keys, and detail views in contexts like: Greenfield SPAs, dashboards, design systems, and full-stack apps that pair Vue with PHP or Node APIs.

Write TypeScript, click Run—Vue 3 loads from CDN with the template compiler, mountApp shows UI in #app, and printOutput feeds the terminal.

When you can explain the previous lesson's ideas without copying starter code.

Master–detail UIs combine a selectable list with a panel showing the active item. Vue tracks list rows with :key on v-for—use stable ids from your data, not array index when order can change.

Selection state

Keep selectedId (or the whole selected object) in a ref. Derive the detail record with computed so the detail panel always reflects list state without duplicate copies.

Keys and focus

Wrong keys make Vue reuse DOM nodes incorrectly—inputs lose focus, animation glitches, and internal state sticks to the wrong row. Prefer item.id from your API.

Compared to React

React’s key prop on list children solves the same reconciliation problem. Both frameworks need stable identity per row.

Self-check

  1. Why is index a risky key when items reorder?
  2. Where should selected item data live—list row state or parent ref?

Tip: Derive the detail panel with computed from selectedId so list and detail never drift out of sync.

Interview prep

Why do :key values matter?

Keys identify vnode identity across updates—stable ids prevent wrong DOM reuse, lost focus, and stale row state when lists reorder.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Stable id source?
  • Reorder bug example?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump