Skip to content
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

orderBy filter requires additional parameter to perform ordering #1

Closed
webbyelena opened this issue Nov 22, 2016 · 1 comment
Closed

Comments

@webbyelena
Copy link

Heres the code that should work according to the documentation:
<li v-for="user in orderBy(users, 'name')">
but the sort will not work with this setup. But if we add another argument it will work:
<li v-for="user in orderBy(users, 'name', 'name')">

Same for the reverse sorting:
<li v-for="user in orderBy(users, 'name', -1)"> - doesnt work
<li v-for="user in orderBy(users, 'name', 'name', '-1')"> - works

I`ve checked the code for the orderBy filter. Seems the problem is in the way how the sortorder is retrieved and args array is adjusted after that and how the sortKey is retrieved after that. I can submit a pull request if needed.

freearhey added a commit that referenced this issue Nov 23, 2016
@freearhey
Copy link
Owner

Thanks for the help!

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

2 participants