Data validation-validation rules-confusing required-if #3441
Labels
done
This issue is done, which may be release in next version.
enhancement
help wanted
planned
This issue/proposal is planned into our next steps.
required-if的困惑
关于required-if校验规则:
中文文档中说明为:
必需参数(当任意所给定字段值与所给值相等时,即:当field字段的值为value时,当前验证字段为必须参数)。多个字段以,号分隔。
而其英文注释为:
Required unless all given field and its value are equal.
而其代码实现为:
综合看起来,代码实现跟中文说明相符,而与英文注释不符。
同理required-unless也有相应confuse!
建议:
将required-if拆分为多个更易于理解的规则,例如:
required-if-all-eq: 如果所有条件符合,则该字段必须;
required-if-any-eq: 如果任一条件符合,则该字段必须;
The text was updated successfully, but these errors were encountered: