From 204136266f0c5b856fe8ac02b0d2819e1b861e84 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 6 Feb 2022 18:56:45 +0100 Subject: [PATCH] chore: watch values instead of listening to changes --- src/components/date/datepickerWithRange.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index 20b9f2dd..7b6bd2ee 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -23,7 +23,7 @@ {{ $t('input.datepickerRange.from') }}
- +
@@ -34,7 +34,7 @@ {{ $t('input.datepickerRange.to') }}
- +
@@ -48,7 +48,9 @@

{{ $t('input.datepickerRange.math.canuse') }} - {{ $t('input.datepickerRange.math.learnhow') }} + + {{ $t('input.datepickerRange.math.learnhow') }} +

from, inputChanged) +watch(() => to, inputChanged) function setDateRange(range: string[] | null) { if (range === null) { from.value = '' to.value = '' - inputChanged() return } @@ -253,7 +256,6 @@ function setDateRange(range: string[] | null) { from.value = range[0] to.value = range[1] - inputChanged() } const customRangeActive = computed(() => { @@ -261,13 +263,13 @@ const customRangeActive = computed(() => { }) const buttonText = computed(() => { - if(from.value !== '' && to.value !== '') { + if (from.value !== '' && to.value !== '') { return t('input.datepickerRange.fromto', { from: from.value, to: to.value, }) } - + return t('task.show.select') })