Basic sorting
This commit is contained in:
parent
5a9ae69368
commit
16ca3af64b
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue