From 4c2ed237bbec6c8677942333b89702bb7470dc38 Mon Sep 17 00:00:00 2001 From: Walter Tommasi Date: Wed, 7 Nov 2018 23:41:25 +0100 Subject: [PATCH] Fix #1072 sorting boolean fields --- src/components/table/Table.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/table/Table.vue b/src/components/table/Table.vue index 27a652716..ceb6ce67d 100644 --- a/src/components/table/Table.vue +++ b/src/components/table/Table.vue @@ -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