From 8c61da296d56c5580bac7fcf97825e97759de03a Mon Sep 17 00:00:00 2001 From: pskfyi Date: Mon, 10 Jan 2022 02:15:49 -0800 Subject: [PATCH] refactor: clean up progress button; emit click event --- components/ProgressButton.vue | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/components/ProgressButton.vue b/components/ProgressButton.vue index 3b758b9..1185c7a 100644 --- a/components/ProgressButton.vue +++ b/components/ProgressButton.vue @@ -1,27 +1,34 @@ @@ -35,8 +42,13 @@ export default { max: { type: Number, required: true }, value: { type: [Number, Decimal], required: true }, unit: { type: String, default: null }, + current: { type: String, default: null }, + next: { type: String, default: null }, }, computed: { + cappedValue() { + return this.value > this.max ? this.max : this.value + }, clickable() { return this.value >= this.max }, @@ -52,9 +64,6 @@ export default {