From ef028794ac3a551499c3d6008060e5d32e435019 Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 1 Jul 2021 17:05:02 +0800 Subject: [PATCH] sort dashboard home event list --- src/pages/DashboardHome.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pages/DashboardHome.vue b/src/pages/DashboardHome.vue index 27c8adf38..820842bac 100644 --- a/src/pages/DashboardHome.vue +++ b/src/pages/DashboardHome.vue @@ -117,6 +117,16 @@ export default { } } + result.sort((a, b) => { + if (a.time > b.time) { + return -1; + } else if (a.time < b.time) { + return 1; + } else { + return 0; + } + }); + return result; } }