From d56236f7727aba5c7b63c3f705b4e69a388f480c Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 9 May 2019 13:17:21 +0200 Subject: [PATCH] add sort --- client/src/store/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/store/index.js b/client/src/store/index.js index 69a9202..9804620 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -71,6 +71,9 @@ const mutations = { }else{ state.arrayresultchaines.push({chaine: payload.chaine,name: payload.name,emission: payload.emission}); } + state.arrayresultchaines=state.arrayresultchaines.sort(function (a,b){ + return ((a.chaine < b.chaine) ? -1 : ((a.chaine > b.chaine) ? 1 : 0)); + }) }, setUserData (state, payload) { console.log('setUserData payload = ', payload)