mirror of https://github.com/ElemeFE/element
Table: support sort-by. can't sort if sort-by is null
parent
f642294949
commit
877718099e
|
@ -40,10 +40,9 @@ export const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
|
|||
});
|
||||
}
|
||||
if (sortKey !== '$key') {
|
||||
if (isObject(value) && '$value' in value) return [value.$value];
|
||||
} else {
|
||||
return [isObject(value) ? getValueByPath(value, sortKey) : value];
|
||||
if (isObject(value) && '$value' in value) value = value.$value;
|
||||
}
|
||||
return [isObject(value) ? getValueByPath(value, sortKey) : value];
|
||||
};
|
||||
const compare = function(a, b) {
|
||||
if (sortMethod) {
|
||||
|
|
Loading…
Reference in New Issue