diff --git a/src/utils/commons.js b/src/utils/commons.js index 51b7cc8..6c1f0b4 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -154,7 +154,7 @@ export function isEmpty(val) { * 数组排序 */ export const sortBy = key => { - return (a, b) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0); + return (a, b) => (getNestedValue(a, key) > getNestedValue(b, key) ? 1 : getNestedValue(b, key) > getNestedValue(a, key) ? -1 : 0); }; /**