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 form reset does not reset the multi-select dropdown box correctly #5445

Closed
1 task
Remiliia opened this issue Apr 7, 2022 · 4 comments
Closed
1 task
Labels

Comments

@Remiliia
Copy link

Remiliia commented Apr 7, 2022

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

Version

3.1.0

Environment

vue 3.2.31

Reproduction link

Edit on CodeSandbox

Steps to reproduce

表单中使用select 组件的mode为multiple时,重置表单方法不能正确重置表单数据

What is expected?

将表单数据重置为初始状态

What is actually happening?

表单数据未正确重置

@github-actions github-actions bot changed the title form表单重置不能正确重置多选下拉框 form form reset does not reset the multi-select dropdown box correctly Apr 7, 2022
@Remiliia
Copy link
Author

Remiliia commented Apr 7, 2022

数据重置是 formState.multiple.length = 0; restform函数中的 formRef.value.resetFields(); 是验证格式用的

官方文档是说的resetFields "对整个表单进行重置,将所有字段值重置为初始值并移除校验结果"
那调用是不是应该重置表单字段为初始的呢

@YuShengHou
Copy link

用rules必须将name和你的form对应,你的初始值也要和规则的类型一致
image
image

@Remiliia Remiliia closed this as completed Apr 7, 2022
@Remiliia
Copy link
Author

Remiliia commented Apr 7, 2022

已解决,感谢

@github-actions
Copy link

github-actions bot commented Apr 8, 2023

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 Apr 8, 2023
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