Replies: 3 comments 15 replies
-
|
如果只是自定义组件内部消费,为啥不直接创建context下发下去 |
Beta Was this translation helpful? Give feedback.
-
|
使用Context可以解决,但繁杂,且每个组件都需要明确感知Context的存在,但实际并不想每个组件都去新开发一次 & 消费Context。 |
Beta Was this translation helpful? Give feedback.
-
|
如果是依赖某些全局的数据,比如引用的 store 数据,想要在 json schema 中去引用,有什么好的方法吗,目前我是通过挂在一个 field 的scope 上面,然后在 json schema 中去引用 {{xxx}}。目前项目中比较多依赖的数据,需要在 schema 中的很多属性用到,比如 visible, reaction, validator 等等。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
类似
Field模型的 data 属性,把一些全局的数据&状态挂载到 Form 扩展属性上,能很大程度上简化使用一些场景化例子
eg:
将全局样式&属性挂载到 form 上,在自定义组件中去消费
eg2:
在表单初始化前去拉取全局数据,然后挂载到表单上,field 里取消费数据
eg3:
表单的状态,如是否为编辑态 isEdit ,在组件中去消费这个状态展示不同的样式
Beta Was this translation helpful? Give feedback.
All reactions