Skip to content

Add id to todo-item component #1047

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 2 commits into from
Jul 30, 2017
Merged

Conversation

john-cheesman
Copy link
Contributor

Give each todo item an id property to use as the key in the v-for loop. As discussed in #4825.

Give each todo item an id property to use as the key in the v-for loop. As discussed in #4825.
Copy link
Member

@nickmessing nickmessing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, the key is a common question and this example could help newcomers a lot.

@chrisvfritz
Copy link
Contributor

The id generation needed a slight tweak to prevent duplicates after removing some todos, then adding more - but otherwise looks good. 👍

@chrisvfritz chrisvfritz merged commit ff2e37f into vuejs:master Jul 30, 2017
@john-cheesman
Copy link
Contributor Author

great, thanks for reviewing it

@Alex-Sokolov Alex-Sokolov mentioned this pull request Jul 31, 2017
kazupon pushed a commit to kazupon/vuejs.org that referenced this pull request Oct 1, 2017
* fix style in list example

* update timestamp

* Add id to todo-item component (vuejs#1047)

* Add id to todo-item component

Give each todo item an id property to use as the key in the v-for loop. As discussed in #4825.

* Fix id generation in simple todos example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants