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.Item ref has no onFieldBlur and onFieldChange events #4183

Closed
1 task
liulei92 opened this issue Jun 9, 2021 · 2 comments
Closed
1 task

Form.Item ref has no onFieldBlur and onFieldChange events #4183

liulei92 opened this issue Jun 9, 2021 · 2 comments
Labels

Comments

@liulei92
Copy link

liulei92 commented Jun 9, 2021

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

Version

2.2.0-beta.2

Environment

vue3.1.1

Reproduction link

https://2x.antdv.com/components/form-cn

Steps to reproduce

https://codesandbox.io/s/confident-galois-3wyp6?file=/src/App.vue:793-799

可以在form-item中存在一个以上的表单元素时,再通过ref的方式获取form-item的实例,发现重构后的

{
id: undefined
htmlFor: undefined
prefixCls: undefined
label: undefined
help: undefined
extra: undefined
labelCol: undefined
wrapperCol: undefined
hasFeedback: false
colon: undefined
labelAlign: undefined
prop: undefined
name: "name"
rules: undefined
autoLink: true
required: undefined
validateFirst: undefined
validateStatus: undefined
validateTrigger: undefined
messageVariables: undefined
hidden: false
setState: ƒ bound setState() {}
}

无onFieldBlur 和 onFieldChange事件了

What is expected?

期望form-item暴露onFieldBlur 和 onFieldChange事件

What is actually happening?

同上步骤

@github-actions github-actions bot changed the title Form.Item的ref无onFieldBlur 和 onFieldChange事件了 Form.Item ref has no onFieldBlur and onFieldChange events Jun 9, 2021
@tangjinzhou
Copy link
Member

onFieldBlur 和 onFieldChange 同样是内部方法,即便暴露出来,未来都有可能改变,你应该使用 formRef.validateFields 方法

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants