Skip to content
New issue

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

未兼容,e === false,导致其他基于 validate 封装的上层库校验功能失败 #19

Open
woshilaoge opened this issue Apr 23, 2021 · 3 comments
Labels
wontfix This will not be worked on

Comments

@woshilaoge
Copy link

woshilaoge commented Apr 23, 2021

image

如上图

当 e === false 时,且 rule.message 有值时,按照之前的代码,有提示信息 rule.message,但是现在调整后的,不会有提示。表现为,之前设置 e 为 false 则不生效了。

image
乐高 form-helper 这块如上图的设计,就导致了,大部分用户是这么去使用的 return false,本次 1.2.2 的版本,就会让之前的设置不生效。

目前乐高上陆续有收到多个用户反馈,之前设置的 校验规则,不生效了。期望尽快兼容~

@bindoon
Copy link
Member

bindoon commented Dec 15, 2021

callback(true) 代表有错误,还是 callback(false) 代表有错误呢? 这么用会比较迷惑!

@bindoon bindoon added the wontfix This will not be worked on label Dec 15, 2021
@woshilaoge
Copy link
Author

这块的 乐高因为历史设计的原因,是有些迷惑。事实上 这个函数返回

  1. string 类型时,直接提示 string 值(错误值)
  2. bool 类型是,无论 true 还是 false ,都会再判断 rule.message,是否为真,如果有值还是会提示的

@bindoon
Copy link
Member

bindoon commented Dec 22, 2021

所以 true 和 false 是会迷惑,目前是把 返回 true/false 忽略了,要不然大家只要填了 message 就报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants