We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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.setFieldValue(test,123), antd Form 可以通过设置 preserve 字段 为true 用form.getFieldsValue(true) 来获取到这种隐藏字段 在useAntdTable中, server回调函数getTableData 的第二个参数 formData则没法包含这个隐藏字段, 虽然可以自己用form再去获取,但是如果能通过配置 自动 返回这种包含隐藏字段的 formData更好, 希望ahooks的useAntdTable也能通过某个配置 来直接获取到包含隐藏字段的formData
The text was updated successfully, but these errors were encountered:
我的建议是你需要显式的声明,及即使用不着他的表单功能。如果这些字段特别多,你更应该这样做。
<Form.Item name='xx' style={{width:0, height:0}}/>
Sorry, something went wrong.
@raotaohub 有时候有些控件希望对应多个字段,比如range-picker 组件的值是数组但是往往后端接收的是两个字段, 我是封装 接受startkey 和endKey, 然后 给formInstance上 form.setfieldValue(startKey,xxx)这样方便也不用显式声明控件
实际业务中这个问题确实很常见,我的做法是提交前写一个转换函数。 pro components 的高级Form组件其实就有 transform 和cover 的回调用来在提交时转换数据格式。只能说业务千变万化,组件只能尽可能提供灵活的抽象,但是没办法涵盖全部场景。。毕竟很多细节的实现没有标准化
hchlq
No branches or pull requests
有时候 我想直接 给form上塞一些字段,
但又不需要相关的表单控件,比如直接给form.setFieldValue(test,123),
antd Form 可以通过设置 preserve 字段 为true 用form.getFieldsValue(true) 来获取到这种隐藏字段
在useAntdTable中, server回调函数getTableData 的第二个参数 formData则没法包含这个隐藏字段, 虽然可以自己用form再去获取,但是如果能通过配置 自动 返回这种包含隐藏字段的 formData更好,
希望ahooks的useAntdTable也能通过某个配置 来直接获取到包含隐藏字段的formData
The text was updated successfully, but these errors were encountered: