We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
form-item组件的rules属性配置为字面量时可以正常工作,配置为变量时只有第一次调用validate方法能正产校验,后续调用返回的valid字段固定为false
请创建最小可复现代码,并上传到你的 GitHub 仓库
rules属性配置变量时也能正常进行校验
官网示例将字面量修改为变量即可 如:
<nut-form-item :rules="rule"></nut-form-item> <script setup> const rule=[{required: true, message:''}] </script>
可能的原因: checkRule方法中使用了Array.shift方法,修改了vnode的props
The text was updated successfully, but these errors were encountered:
<nut-form-item prop="phone" required :rules="rules.phone" > </nut-form-item> const [, result] = await errorCatch(ruleForm.value.validate()) const { valid, errors }: any = result 第一次一定会校验valid 会为false 但是到了第二次,valid就会true, 校验异常了
<nut-form-item prop="phone" required :rules="rules.phone" > </nut-form-item>
Sorry, something went wrong.
fix(form): check rule reference value disconnect #1053
83010a4
v3.1.18 已发布
richard1015
No branches or pull requests
问题描述
form-item组件的rules属性配置为字面量时可以正常工作,配置为变量时只有第一次调用validate方法能正产校验,后续调用返回的valid字段固定为false
最小可复现仓库
预期的行为和实际行为
rules属性配置变量时也能正常进行校验
复现步骤,具体代码
官网示例将字面量修改为变量即可
如:
可能的原因:
checkRule方法中使用了Array.shift方法,修改了vnode的props
相关环境信息
The text was updated successfully, but these errors were encountered: