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

表单验证的错误提示如何手动触发 #133

Closed
1 of 3 tasks
85204 opened this issue Jul 4, 2018 · 2 comments
Closed
1 of 3 tasks

表单验证的错误提示如何手动触发 #133

85204 opened this issue Jul 4, 2018 · 2 comments

Comments

@85204
Copy link

85204 commented Jul 4, 2018

官网的表单验证需要手动填写表单来触发change事件才能实现错误提示,
但是字段未填写的错误提示在用户不填写表单直接提交的时候触发不了。
请问如何触发这个提示?
尝试用
window.dispatchEvent(new Event('onchange'))
之类的事件也没有反应
请问是不是我dispatch的事件名有问题还是什么?
在使用element官网的错误提示下,有什么更好的解决办法吗?

Issue Type:

  • Bug
  • Feature
  • Help
@firstsir0
Copy link

我干过一个坑的,直接在那个值后面几个东西.....然后触发。太临时的解决办法了

@85204
Copy link
Author

85204 commented Sep 27, 2018

我干过一个坑的,直接在那个值后面几个东西.....然后触发。太临时的解决办法了

已经解决了,代码参考antd相关部分即可
http://ng.ant.design/components/form/zh#components-form-demo-normal-login

@85204 85204 closed this as completed Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants