Commit 87771809 authored by wangfengming's avatar wangfengming Committed by 杨奕

Table: support sort-by. can't sort if sort-by is null

parent f6422949
...@@ -40,10 +40,9 @@ export const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment