From 16ca3af64ba8e6463180b103d5dd9b44f6f347e1 Mon Sep 17 00:00:00 2001 From: Joe Wroten Date: Fri, 12 May 2017 16:30:07 -0500 Subject: [PATCH] Basic sorting --- src/components/Spelllist.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Spelllist.vue b/src/components/Spelllist.vue index cc15652..273dfd0 100644 --- a/src/components/Spelllist.vue +++ b/src/components/Spelllist.vue @@ -77,13 +77,13 @@ export default { } }, computed: { + dynamicSortBy () { + return this.search.length >= 3 ? 'sortScore' : this.sortBy + }, pageMax () { let trueMax = this.filteredSpells.length / this.perPage return trueMax < 1 ? 1 : trueMax }, - dynamicSortBy () { - return this.search.length >= 3 ? 'sortScore' : 'name' - }, pagedSpells () { return new Query(this.filteredSpells) .paginate(this.page, this.perPage) @@ -92,7 +92,7 @@ export default { filteredSpells () { return new Query(this.spells) .search('name', this.search, 5) - .sort(this.dynamicSortBy) + .sort(this.sortBy) .results } }