fix: When the slider type step size is set to 0, the verification is triggered, and when it is changed to 1, the verification disappears (#3829)

This commit is contained in:
shaohuzhang1 2025-08-06 14:11:55 +08:00 committed by GitHub
parent 885b65cbbe
commit 3c885ddf3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,14 +142,15 @@ const step_rules = [
{
required: true,
validator: (rule: any, value: any, callback: any) => {
if (!value) {
callback(new Error(t('dynamicsForm.Slider.step.requiredMessage1')))
return false
}
if (value === 0) {
callback(new Error(t('dynamicsForm.Slider.step.requiredMessage2')))
return false
}
if (!value) {
callback(new Error(t('dynamicsForm.Slider.step.requiredMessage1')))
return false
}
return true
},
trigger: 'blur',