mirror of https://github.com/ElemeFE/element
Table: support sort-by, use isArray to test sortBy
parent
0a24f05125
commit
f642294949
|
@ -18,7 +18,7 @@ const isObject = function(obj) {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
|
export const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
|
||||||
if (!sortKey && !sortMethod && (!sortBy || Array.isArray && !sortBy.length)) {
|
if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
if (typeof reverse === 'string') {
|
if (typeof reverse === 'string') {
|
||||||
|
|
Loading…
Reference in New Issue