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