Closed mengshang918 closed 1 year ago
在此之前,drip-form不支持内部配置接口查询数据。需要通过外部onQuery查询数据并绑定到相应表单上。
该pr合并后,自定义组件可通过引入配置从而在form-gernerator中配置接口,或任意表单配置queryCofig,在表单didmount或数据满足特定条件时调用接口,并将制定路径的数据结果设置到表单的uiSchema中。
表单数据变化时
接口刷新
fetchApi
type FetchApi = (args: { //请求参数 params: Array<{ key: string; value: string }> //请求url url: string //请求类型 method: 'GET' | 'POST' }) => Promise<unknown>
若不配置,drip-form默认使用浏览器fetch API。
drip-form
fetch API
Y
N
Motivation
在此之前,drip-form不支持内部配置接口查询数据。需要通过外部onQuery查询数据并绑定到相应表单上。
该pr合并后,自定义组件可通过引入配置从而在form-gernerator中配置接口,或任意表单配置queryCofig,在表单didmount或数据满足特定条件时调用接口,并将制定路径的数据结果设置到表单的uiSchema中。
表单数据变化时
条件接口刷新
动作fetchApi
prop 可通过fetchApi自定义请求实现若不配置,
drip-form
默认使用浏览器fetch API
。Have you read the [Contributing Guidelines on pull requests]
Y
Test Plan
N
Related PRs
N