From 292eb994bc211c02eaabb09ed8548b4e7f811c02 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Mon, 28 Oct 2024 14:12:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E6=BB=91=E5=9D=97=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E6=AD=A5=E9=95=BF=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constructor/items/SliderConstructor.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue b/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue index d38b47290..c1c47b5e1 100644 --- a/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue +++ b/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue @@ -39,7 +39,7 @@ /> - + @@ -55,7 +55,7 @@ :show-input-controls="false" :max="formValue.max" :min="formValue.min" - :step="formValue.step" + :step="formValue.step == 0 ? 0.1 : formValue.step" :precision="formValue.precision" /> @@ -107,7 +107,19 @@ const rander = (form_data: any) => { formValue.value.showInput = attrs['show-input'] formValue.value.default_value = form_data.default_value } - +const step_rules = [ + { + required: true, + validator: (rule: any, value: any, callback: any) => { + if (value === 0) { + callback(new Error('步长不能为0')) + return false + } + return true + }, + trigger: 'blur' + } +] defineExpose({ getData, rander }) onBeforeMount(() => { formValue.value.min = 0