mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-13 11:34:02 +08:00
Table: allow omitting prop if sort-method is provided
This commit is contained in:
@@ -21,7 +21,7 @@ export const orderBy = function(array, sortKey, reverse, sortMethod) {
|
||||
if (typeof reverse === 'string') {
|
||||
reverse = reverse === 'descending' ? -1 : 1;
|
||||
}
|
||||
if (!sortKey) {
|
||||
if (!sortKey && !sortMethod) {
|
||||
return array;
|
||||
}
|
||||
const order = (reverse && reverse < 0) ? -1 : 1;
|
||||
|
||||
Reference in New Issue
Block a user