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 (sortKey !== '$key') {
|
||||||
if (isObject(value) && '$value' in value) return [value.$value];
|
if (isObject(value) && '$value' in value) value = value.$value;
|
||||||
} else {
|
|
||||||
return [isObject(value) ? getValueByPath(value, sortKey) : value];
|
|
||||||
}
|
}
|
||||||
|
return [isObject(value) ? getValueByPath(value, sortKey) : value];
|
||||||
};
|
};
|
||||||
const compare = function(a, b) {
|
const compare = function(a, b) {
|
||||||
if (sortMethod) {
|
if (sortMethod) {
|
||||||
|
|
Loading…
Reference in New Issue