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

form中的属性rules asyncValidator和validator的方法,第一个入参类型问题 #2299

Closed
seafronthu opened this issue Jan 27, 2022 · 2 comments · Fixed by #2314
Closed
Labels

Comments

@seafronthu
Copy link
Contributor

TuSimple/naive-ui version (版本)

2.24.6

Vue version (Vue 版本)

3.2.29

Browser and its version (浏览器及其版本)

edge 版本 96.0.1054.57 (官方内部版本) (x86_64)

System and its version (系统及其版本)

MacOs

Node version (Node 版本)

Reappearance link (重现链接)

https://www.naiveui.com/zh-CN/os-theme/components/form

Reappearance steps (重现步骤)

vue3 typescript
使用form组件属性rules

Expected results (期望的结果)

validator (rule: FormItemRule, value: any) => boolean | Error 校验规则;
asyncValidator (rule: FormItemRule, value: any, callback: boolean => void) => void 异步校验,支持定义回调函数;
rule入参类型就是FormItemRule

Actual results (实际的结果)

实际上rule是InternalRuleItem类型,并且没有导出

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Jan 27, 2022
@Talljack
Copy link
Contributor

我们调用的validator的rule值的就是async-validator的validator的参数
image

@07akioni
Copy link
Collaborator

可能我们需要重新导出一下

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

Successfully merging a pull request may close this issue.

3 participants