From fb44be6804faae60519e7a88e04991102e6d65f7 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 18 Jun 2024 12:39:22 +0300 Subject: [PATCH] zero input --- components/calcValues.vue | 14 ++++++-------- components/model/fence.vue | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/components/calcValues.vue b/components/calcValues.vue index 24612e6..6b4bc8b 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -50,6 +50,9 @@ const form_refs = { } const changeParametres = () => { + if(form_state.total_length * 1000 < parametric.length.min) { + return + } const lamelles = Math.floor(form_state.height / parametric.height.step) for (const key in form_state) { @@ -99,12 +102,6 @@ const changeParametres = () => { if (form_state.extra_section && form_state.extra_section < parametric.length.min) { form_refs.total_length.value.setCustomValidity('Расчет невозможен') } - setTimeout(() => { - if (form_state.total_length < parametric.total_length.min) { - form_state.total_length = parametric.total_length.min - form_state.length = parametric.length.min - } - }, 600) total_length.value = form_state.total_length lamelles_count.value = lamelles @@ -200,9 +197,10 @@ const plurals = { {{ section_count }} по {{ form_state.length.toFixed(2) }}{{ '\xa0' }}мм. + и 1 дополнительная секция длиной {{ form_state.extra_section.toFixed(2) }}{{ '\xa0' + }}мм.

-

+

Всего