Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/guide/migration/key-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ In Vue 2.x, a `<template>` tag could not have a `key`. Instead, you could place
```html
<!-- Vue 2.x -->
<template v-for="item in list">
<div :key="item.id">...</div>
<span :key="item.id">...</span>
<div :key="'heading-' + item.id">...</div>
<span :key="'content-' + item.id">...</span>
</template>
```

Expand All @@ -79,8 +79,8 @@ Similarly, when using `<template v-for>` with a child that uses `v-if`, the `key
```html
<!-- Vue 2.x -->
<template v-for="item in list">
<div v-if="item.isVisible" :key="item.id">...</div>
<span v-else :key="item.id">...</span>
<div v-if="item.isVisible" :key="'heading-' + item.id">...</div>
<span v-else :key="'content-' + item.id">...</span>
</template>

<!-- Vue 3.x -->
Expand Down