From 9f3cdd4f1b0369f2dc2b367241dd733be800217d Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 3 Dec 2018 12:15:22 +0100 Subject: [PATCH] Feat: manager case when there is no datas --- src/store/modules/datas.js | 3 ++ src/views/home.vue | 76 +++++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/store/modules/datas.js b/src/store/modules/datas.js index 3163efc..4c6c277 100644 --- a/src/store/modules/datas.js +++ b/src/store/modules/datas.js @@ -27,6 +27,9 @@ export default { rows: (state) => { return state.rows.data }, + present: (state) => { + return state.rows.data.length > 0 + }, spending_rows: (state, getters) => { return getters.rows.filter(x => x.Montant < 0) }, diff --git a/src/views/home.vue b/src/views/home.vue index afabf91..f041000 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -1,43 +1,50 @@ @@ -89,7 +96,7 @@ export default { ...mapGetters({ 'csvs': 'datas/csvs', 'tag_filter_rows': 'datas/tag_filter_rows', - 'rows': 'datas/rows', + 'datas_present': 'datas/present', 'start': 'datas/start', 'end': 'datas/end', 'tags': 'config/tags' @@ -118,7 +125,10 @@ export default {