From 9333b0d48f28e7f52821508c94cb2ad0fc21ad6d Mon Sep 17 00:00:00 2001 From: pskfyi Date: Mon, 10 Jan 2022 21:46:55 -0800 Subject: [PATCH] chore: adjust click event and expand unit possibilities --- components/ProgressButton.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/ProgressButton.vue b/components/ProgressButton.vue index 6ae83f1..d7a8dfb 100644 --- a/components/ProgressButton.vue +++ b/components/ProgressButton.vue @@ -3,7 +3,7 @@ class="relative flex flex-col pt-2 pb-3 px-3 border rounded-lg overflow-hidden border-current" :class="[colorClasses, clickable ? 'cursor-pointer' : 'cursor-default']" :disable="!clickable" - @click="$emit('click')" + @click="clickable && $emit('click')" > - {{ cappedValueText }} / {{ maxText }} + L{{ cappedValueText }} + / + L{{ maxText }} @@ -50,14 +52,12 @@ export default { return this.value > this.max ? this.max : this.value }, cappedValueText() { - return this.unit === 'spareTime' - ? this.cappedValue - : this.$store.getters.ageText + return this.unit === 'maxAge' + ? this.$store.getters.ageText + : this.cappedValue }, maxText() { - return this.unit === 'spareTime' - ? this.max - : this.$store.getters.ageMaxText + return this.unit === 'maxAge' ? this.$store.getters.ageMaxText : this.max }, clickable() { return this.value >= this.max