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 表单 希望能提供设置单个 FormItem 的能力 #2091

Open
4yan opened this issue Mar 27, 2023 · 3 comments
Open

Form 表单 希望能提供设置单个 FormItem 的能力 #2091

4yan opened this issue Mar 27, 2023 · 3 comments
Labels

Comments

@4yan
Copy link

4yan commented Mar 27, 2023

这个功能解决了什么问题

比如说在用户修改了某个字段的情况下,我需要清空另一个字段,如果我使用 setFieldsValue 方法,表单的内容会被全量刷新,体验不够好。

你建议的方案是什么?

提供一个 setFieldValue 方法,接收两个参数,(name: 要修改的字段路径, value: 修改的值)

@github-actions
Copy link
Contributor

👋 @4yan,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@honkinglin
Copy link
Collaborator

setFieldsValue 其实就包含了单个选项的修改
https://stackblitz.com/edit/react-jdfrb7?file=src%2Fdemo.jsx

@4yan
Copy link
Author

4yan commented Mar 30, 2023

嗯,但如果是一个FormList,里面就得item和上面的demo里的一样,使用setFieldsValue就比较麻烦了

@HaixingOoO HaixingOoO added enhancement New feature or request Stale and removed enhancement New feature or request labels Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants