Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

使用 useForm API 进行表单校验的问题 #30

Open
1 task
yangss3 opened this issue Dec 16, 2020 · 5 comments
Open
1 task

使用 useForm API 进行表单校验的问题 #30

yangss3 opened this issue Dec 16, 2020 · 5 comments

Comments

@yangss3
Copy link

yangss3 commented Dec 16, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.0.0-rc.4

Environment

Vue3

Reproduction link

https://codesandbox.io/s/practical-driscoll-ysu15?file=/src/App.vue

Steps to reproduce

填写表单所有必填字段后,点击提交按钮执行 validate 进行校验,界面无警告,控制台也无警告,但是validate会走catch

What is expected?

能正常通过校验

What is actually happening?

所有必填字段都有值,且无任何警告,但是validate会跳到catch

@Amour1688 Amour1688 transferred this issue from vueComponent/ant-design-vue Dec 17, 2020
@lubezhang
Copy link

经测试userForm返回的响应式对象validateInfos没有数据变化

@yangss3
Copy link
Author

yangss3 commented Feb 24, 2021

经测试userForm返回的响应式对象validateInfos没有数据变化

这个例子的问题出在哪?

@tangjinzhou
Copy link
Member

赋值后不要直接 validate 放在 setTimeout 里先
后续优化

@BoringDays
Copy link

目前在用useform也出现了这个问题,甚至在官网示例也可以看到,验证结果没有在表单体现,这究竟是特性还是bug,使用useform应该如何调整才可以在表单直接显示错误信息?

@linqinghao
Copy link

遇到相似的问题,页面没有展示错误信息,但是validate 走catch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants