Skip to content

Use keyed loop in guide in line with the style guide #1767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2018
Merged
Changes from all commits
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
10 changes: 6 additions & 4 deletions src/v2/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ There are quite a few other directives, each with its own special functionality.
``` html
<div id="app-4">
<ol>
<li v-for="todo in todos">
<li v-for="todo in todos"
:key="todo.id"
>
{{ todo.text }}
</li>
</ol>
Expand All @@ -162,9 +164,9 @@ var app4 = new Vue({
el: '#app-4',
data: {
todos: [
{ text: 'Learn JavaScript' },
{ text: 'Learn Vue' },
{ text: 'Build something awesome' }
{ id: 1, text: 'Learn JavaScript' },
{ id: 2, text: 'Learn Vue' },
{ id: 3, text: 'Build something awesome' }
]
}
})
Expand Down