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

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

Closed
sanmuw opened this issue Apr 30, 2024 · 7 comments

Comments

@sanmuw
Copy link

sanmuw commented Apr 30, 2024

Bug Type: Component

Environment

  • Vue Version: 3.2.47
  • Element Plus Version: 2.3.0
  • Browser / OS: Chrome/mac
  • Build Tool: Vite

Reproduction

Related Component

  • el-form

Reproduction Link

Element Plus Playground

Steps to reproduce

What is Expected?

能获取getFeildsvalue类型的api

What is actually happening?

没有

Additional comments

动态表单能获取到的展示的表单项值,而不是model所有的字段

@Fuphoenixes
Copy link
Contributor

因为vue是双向绑定,直接通过model.xxx就可以动态获取对应项的当前值了。你是刚从react antd 那边转过来吗?建议你去看 Ant Design Vue 都不用提供 getFieldsvalue 方法。

@sanmuw
Copy link
Author

sanmuw commented Apr 30, 2024

因为vue是双向绑定,直接通过model.xxx就可以动态获取对应项的当前值了。你是刚从react antd 那边转过来吗?建议你去看 Ant Design Vue 都不用提供 getFieldsvalue 方法。

不是哦 表单有10种动态展示,也就是说每一种都有字段差异,而我每次拿到都是10种的集合,不能每次拿到当前集合吗?注意的是:这个表单有30多个字段,每一种都有差异,例如:第一种可能只有15个字段展示,第二种可能有23个字段展示,第三种,有22个字段展示等等,为何每次拿到的是30个字段?

@sanmuw
Copy link
Author

sanmuw commented Apr 30, 2024

因为vue是双向绑定,直接通过model.xxx就可以动态获取对应项的当前值了。你是刚从react antd 那边转过来吗?建议你去看 Ant Design Vue 都不用提供 getFieldsvalue 方法。

antd vue 它可以通过finish拿到values

@Fuphoenixes
Copy link
Contributor

抱歉是我看错了,你是想通过类似getFieldsvalue的手段获取当前所有注册了的表单项的值。后续可以考虑添加对应api,同时也欢迎你来贡献!

@Fuphoenixes Fuphoenixes reopened this Apr 30, 2024
@sanmuw
Copy link
Author

sanmuw commented Apr 30, 2024

抱歉是我看错了,你是想通过类似getFieldsvalue的手段获取当前所有注册了的表单项的值。后续可以考虑添加对应api,同时也欢迎你来贡献!
是我表达的问题,哈哈哈。有机会一定来贡献 codes

@xylplm
Copy link

xylplm commented May 6, 2024

+1 希望提供一个能够拿到表单所有的对象值,用于表单直接提交。而不是一个一个取值

@FrontEndDog
Copy link
Member

fixed by #16755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants