Skip to content

key attribute set by v-bind="obj" is ignored by transition-group #5881

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

Closed
nirazul opened this issue Jun 14, 2017 · 4 comments
Closed

key attribute set by v-bind="obj" is ignored by transition-group #5881

nirazul opened this issue Jun 14, 2017 · 4 comments

Comments

@nirazul
Copy link

nirazul commented Jun 14, 2017

Version

2.3.4

Reproduction link

https://codepen.io/Nirazul/pen/RgGRjm

Steps to reproduce

  1. Click on the trigger button
  2. There is only one list visible instead of two

What is expected?

According to the documentation I was expecting that I can use the v-bind object notation to set the key attribute.

What is actually happening?

The list is not rendered when the key attribute is not directly present on the element.


I'm aware that key is a special attribute and that there may be some sort of "hen and egg" problem at work when rendering items in a transition-group.
If the behaviour is intentional, there's maybe some space for improvement in the documentation.

@nirazul nirazul changed the title v-for doesn't work with key attribute set by v-bind (object notation) key attribute set by v-bind="obj" is ignored by transition-group Jun 14, 2017
@yyx990803
Copy link
Member

Yeah, we should improve the docs regarding the special case for key. In fact all reserved attributes cannot be bound using v-bind object syntax.

/cc @chrisvfritz

@gebilaoxiong
Copy link
Member

gebilaoxiong commented Jun 14, 2017

@yyx990803
Copy link
Member

@gebilaoxiong ah, I realized it should indeed be fixable. Just check for the special keys in https://github.com/vuejs/vue/blob/dev/src/core/instance/render-helpers/bind-object-props.js

@gebilaoxiong
Copy link
Member

@yyx990803

OK, boss

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

No branches or pull requests

3 participants