Skip to content

Multiple field order by #2562

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
Mar 29, 2016
Merged

Conversation

posva
Copy link
Member

@posva posva commented Mar 25, 2016

This is refers to the feature request #2518

I replaced the deconstructing array with a simple array because it makes it easier to use an array from data or computed properties: files | orderBy sortKeys instead of files | orderBy 'name' 'size' with sortKeys = ['name', 'size']. Tell me your thoughts about it

@posva posva force-pushed the feature/multiple-field-orderBy branch from 53bb214 to eb9e0c9 Compare March 26, 2016 15:42
@posva posva removed the in progress label Mar 26, 2016
@posva
Copy link
Member Author

posva commented Mar 28, 2016

Ping @yyx990803


// sort on a copy to avoid mutating original array
return arr.slice().sort(function (a, b) {
return recursiveCompare(a, b, 0)
Copy link
Member

Choose a reason for hiding this comment

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

we can jsut sort(recursiveCompare) if we do i = i || 0 in it right? Otherwise LGTM.

@posva posva force-pushed the feature/multiple-field-orderBy branch from eb9e0c9 to 04a213b Compare March 29, 2016 08:47
@posva
Copy link
Member Author

posva commented Mar 29, 2016

@yyx990803 Thanks for the update, I didn't think about the unnecessary function call 😄 . I fixed that and also squashed everything into a single commit. I made a backup in case you prefer it the other way, just tell me if you want me to switch back to the 4 commits version 😉

@yyx990803 yyx990803 merged commit fb876ef into vuejs:dev Mar 29, 2016
@yyx990803
Copy link
Member

👍 good job!

@posva posva deleted the feature/multiple-field-orderBy branch March 30, 2016 19:09
@posva posva removed the in review label Mar 30, 2016
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