From 0cbf9ca7fbe5fba32a07fe617c1f411f28b045ab Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Tue, 3 Nov 2020 15:41:15 +0100 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=8E=A8=E8=8D=90=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Recommandation.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Recommandation.vue b/src/components/Recommandation.vue index a418658..6952a82 100644 --- a/src/components/Recommandation.vue +++ b/src/components/Recommandation.vue @@ -194,8 +194,7 @@ export default { axios.get(url).then(res => { if (res.status === 200) { if (res.data.length > 0) { - this.recommandations = res.data - this.recommandations.sort(function (a, b) { + this.recommandations = res.data.sort(function (a, b) { return b.detail.year - a.detail.year }) recommandation.clear().then(recommandation.bulkAdd(this.recommandations)) @@ -276,10 +275,7 @@ export default { }, getRecommandations () { recommandation.all().then(res => { - this.recommandations = res - this.recommandations.sort(function (a, b) { - return b.detail.year - a.detail.year - }) + this.recommandations = res.reverse() this.getFilterData() }) },