[Vuejs]-Vue filtered list also orderBy something afterwards?

1👍

@boussadjira’s answer is fine, but if you really don’t want the extra function, just use the following as the return from filteredUsers()

return _.orderBy(
    this.users.filter(user => find(user, this.search)),
    'name'
);

(and similarly in the short-circuit return when search is empty)

-1👍

Using linq js lib.

 computed: {
    filteredUsers {
      return Enumerable.From(this.users).OrderBy(x => x.name).ToArray();
    }
 }

Leave a comment