Skip to content

Added keys to examples on List Rendering #810

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
Jan 15, 2021
Merged

Conversation

NataliaTepluhina
Copy link
Member

As explained in #796, we decided to make keys recommended for all cases. To make this more visible, we add key to all the code examples after we explained what key is

@@ -189,7 +189,7 @@ There are quite a few other directives, each with its own special functionality.
```html
<div id="list-rendering">
<ol>
<li v-for="todo in todos" v-bind:key="todo.text">
Copy link
Member Author

Choose a reason for hiding this comment

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

@skirtles-code after some thinking I agreed with your point and removed this attribute to prevent a cognitive overhad

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

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

Looks good.

Longer term I'd like to change some of those examples to use the object directly as the key, rather than a property. That seems to work with Vue 3 but I don't believe it's been officially acknowledged as a supported feature, so I don't think we can use it in the docs yet. There's already #698 tracking this.

@NataliaTepluhina NataliaTepluhina merged commit b8ef369 into master Jan 15, 2021
@NataliaTepluhina NataliaTepluhina deleted the fix-keys branch February 24, 2021 08:34
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.

2 participants