1
0
Fork 0

Basic sorting

This commit is contained in:
Joe Wroten 2017-05-12 16:30:07 -05:00
parent 5a9ae69368
commit 16ca3af64b

View file

@ -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
}
}