From 99c43bdd6652becc349c7c83595f50791bbe515b Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 10 Oct 2024 15:05:00 +0700 Subject: [PATCH] refactor: debounce on typing --- src/components/05_quotation/ProductItem.vue | 2 ++ src/pages/05_quotation/QuotationFormInfo.vue | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/05_quotation/ProductItem.vue b/src/components/05_quotation/ProductItem.vue index 394a196c..3793fc5e 100644 --- a/src/components/05_quotation/ProductItem.vue +++ b/src/components/05_quotation/ProductItem.vue @@ -326,6 +326,7 @@ watch( :type="readonly ? 'text' : 'number'" style="width: 70px" min="0" + debounce="500" v-model="props.row.amount" /> @@ -347,6 +348,7 @@ watch( input-class="text-right" :type="readonly ? 'text' : 'number'" style="width: 90px" + debounce="500" v-model="props.row.discount" /> diff --git a/src/pages/05_quotation/QuotationFormInfo.vue b/src/pages/05_quotation/QuotationFormInfo.vue index 9bef79ec..9008f34b 100644 --- a/src/pages/05_quotation/QuotationFormInfo.vue +++ b/src/pages/05_quotation/QuotationFormInfo.vue @@ -497,7 +497,9 @@ watch( outlined class="q-ml-auto price-tag" input-class="text-right" - v-model="finalDiscount" + debounce="500" + :model-value="finalDiscount" + @update:model-value="(v) => (finalDiscount = Number(v))" />