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

fix: keep validateInfos reactive #4557

Closed
wants to merge 1 commit into from
Closed

fix: keep validateInfos reactive #4557

wants to merge 1 commit into from

Conversation

ylc395
Copy link
Contributor

@ylc395 ylc395 commented Aug 22, 2021

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

validateInfos will be initialized only once. If rulesRef's value is updated, validateInfos just keep the same key as before, so validateInfos[name].validateStatus will throw a error(TypeError: Cannot set property 'validateStatus' of undefined).

fix #4498

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@ylc395
Copy link
Contributor Author

ylc395 commented Aug 24, 2021

@tangjinzhou 能帮忙 review 下么,有问题随时沟通

tangjinzhou added a commit that referenced this pull request Aug 24, 2021
@tangjinzhou
Copy link
Member

看下这个 c6c004c

@tangjinzhou
Copy link
Member

你不能更改 validateInfos 为新的响应式对象, 这样用户侧会丢失响应式

@ylc395
Copy link
Contributor Author

ylc395 commented Aug 24, 2021

你不能更改 validateInfos 为新的响应式对象, 这样用户侧会丢失响应式

原 PR 中哪一步会更改为新的响应式对象?应该只会在一开始的时候有一个初始化对象的

@tangjinzhou
Copy link
Member

oo https://github.com/vueComponent/ant-design-vue/pull/4557/files#diff-0f4204076c7328f2713947751d399431de7d0f35ee1ab3ef7d5448addacf6484R137 看错了 ,136行的判断漏掉了 没有保留原校验状态,其它没有大问题

@github-actions
Copy link

This pull request 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 Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use useForm to verify the dynamic form error, unable to dynamically add rules
2 participants