Field.dataSource 支持泛型类型 #4017
MeetzhDing
started this conversation in
Ideas
Replies: 1 comment
-
|
核心场景: 有一个 应用选择 下拉框,字段记为 appid, 加载下拉选项 AppList 后设置到 field.dataSource 中。然后使用 Select 组件进行渲染。 在用户选择完成 appid 后,其他业务区域的内容需要读取 解决思路:
@janryWang @gwsbhqt 麻烦帮忙看看,如果可以接受这个提议,我可以花点时间处理这块的泛型声明,并提出 PR |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
当业务将UI组件的下拉选项请求到以后,会设置给 field.dataSource, 但是当尝试通过 field.dataSource 字段取值时,就没有办法拿回原本的数据类型了。
期望是能够给 Field 加一个额外的泛型参数,比如默认是 DS extends any[] = FieldDataSource, 如果外部有传入就使用外部的类型。
同样适用于 Schema.enum 的类型。
Beta Was this translation helpful? Give feedback.
All reactions