-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
[enhancement] track-by to allow using path instead of key #2632
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
Comments
The feature is cool, but ...err, if http://vuejs.org/guide/list.html#track-by, according to this piece, If you really need a As for the warning info, I've no idea why it appears. update: I got why warning comes out. |
I think both of your proposals would be a good enhancement. |
@Twiknight Duplication happens because the
As you can see,
So the key or path will be valid with I'll look into |
@dragantl I think I mistook your proposal, I thought you were trying to make I totally agree with you. BTW, I mentioned |
This makes sense, I'd welcome a PR if anyone wants to take a crack at it. |
I'll make a PR |
@dragantl oops, I was just working on it. Thanks for the offer tho! |
Vue.js version
1.0.20
Reproduction Link
https://jsfiddle.net/ardoramor/hyk86ca3/
Steps to reproduce
Run fiddle, examine console.
What is Expected?
Entries will be tracked by the specified path, just like in filters (e.g.,
orderBy
)What is actually happening?
VueJs prints out a warning and fails to get the unique value specified by path
Required change
There are three lines that would need to change from
value[trackByKey]
togetPath(value, trackByKey)
in functionscacheFrag
,getCachedFrag
, anddeleteCachedFrag
. I can make a PR but maybe such a small change doesn't require it?Also, is it possible to add expression evaluation for
track-by
? This way, a combination of fields can yield a unique identifier (e.g.,track-by="employee.company + employee.id"
, in caseid
can be reused by companies). I have a different application but this should make sense as well.The text was updated successfully, but these errors were encountered: