Skip to content

Commit

Permalink
Fix #1072 sorting boolean fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jtommy committed Nov 7, 2018
1 parent 63b3db7 commit 4c2ed23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/table/Table.vue
Expand Up @@ -448,6 +448,11 @@
let newA = getValueByPath(a, key)
let newB = getValueByPath(b, key)
// sort boolean type
if (typeof newA === 'boolean' && typeof newB === 'boolean') {
return isAsc ? newA - newB : newB - newA
}
if (!newA && newA !== 0) return 1
if (!newB && newB !== 0) return -1
if (newA === newB) return 0
Expand Down

0 comments on commit 4c2ed23

Please sign in to comment.