From 4bc7e74825dd48a2f10babb68af3d536fe9f4e27 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 7 Aug 2024 09:13:34 +0800 Subject: [PATCH] perf: commons --- src/utils/commons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }; /**