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

feat(components): [form] add getFieldsValue method #16739

Closed
wants to merge 2 commits into from

Conversation

Liao-js
Copy link
Contributor

@Liao-js Liao-js commented May 2, 2024

fix #16719

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Copy link

👋 @Liao-js, thank you for contributing element-plus.

  • You can comment with /label Components:[component_name] to add a label for which component you are working on.
  • You may join our Discord for staying tuned.

Copy link

github-actions bot commented May 2, 2024

Hello @Liao-js, thank you for contributing to element-plus, please see our guideline to see how to make contribution

Copy link

github-actions bot commented May 2, 2024

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label May 2, 2024
Copy link

github-actions bot commented May 2, 2024

🧪 Playground Preview: https://element-plus.run/?pr=16739
Please comment the example via this playground if needed.

@btea
Copy link
Collaborator

btea commented May 4, 2024

The functions of this PR overlap with those discussed in #16747. Directly exporting fields will give users more room to operate.

@Liao-js
Copy link
Contributor Author

Liao-js commented May 4, 2024

The functions of this PR overlap with those discussed in #16747. Directly exporting fields will give users more room to operate.

ok, what do you need me to do?

@Liao-js
Copy link
Contributor Author

Liao-js commented May 4, 2024

directly exporting fields will give users more room to operate,but I think this does not conflict with pr. The functions is more suitable for users who use dynamic forms. It can facilitate users to directly obtain the value of the corresponding structure for direct submission without additional processing of propString.

@btea
Copy link
Collaborator

btea commented May 5, 2024

@tolking Do you think this new method in PR is necessary? IMO, it should be enough to directly export fields and let users handle it themselves.

@btea
Copy link
Collaborator

btea commented May 5, 2024

directly exporting fields will give users more room to operate,but I think this does not conflict with pr. The functions is more suitable for users who use dynamic forms. It can facilitate users to directly obtain the value of the corresponding structure for direct submission without additional processing of propString.

Yes, you have a point. But this is the first time I've seen a need in this area, and this method doesn't seem to be used frequently. I don't know if we should add it, maybe more people should be consulted.

@tolking
Copy link
Member

tolking commented May 5, 2024

IMO, It would be better for users to implement this special requirement by themselves.

The newly added code may be redundant for most people.

@FrontEndDog
Copy link
Member

IMO, This method leans more towards the business level, Not every user needs to submit data of type 'Record<string, any>', It may also be of other types, such as <label: string, value: any>[], So I think it's better to exporting fields and let users handle the data on their own.

在我看来,这个方法更偏向于业务层面,并不是每个用户所需要提交的数据都是Record<string, any>类型的,也可能是其他类型,例如<label: string, value: any>[],所以我认为暴露出fileds字段让用户自行处理数据更好一些。

@Liao-js
Copy link
Contributor Author

Liao-js commented May 6, 2024

I agree with your point of view, I did not consider it comprehensively enough.I will close this PR.

@Liao-js Liao-js closed this May 6, 2024
@Liao-js Liao-js deleted the feat/form_getFieldsValue branch May 6, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Component] [form] form 为何不提供类似getFieldsvalue方法(动态表单,表单项能到达30+)
4 participants