终于搞定了子组件,可实现官方示例那样,在折叠面板中插入其它组件 #333
scil
started this conversation in
Show and tell
Replies: 1 comment
-
示例,在组件内部插入“文本”(官方内置的 Text 组件) 建立“添加文本”的按钮
渲染文本
|
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.
Uh oh!
There was an error while loading. Please reload this page.
-
建立组件或子组件的不同方式
要点:
formily/antd/src/components/FormCollapse/preview.tsx
中的parseCollapse
编辑区里,如果子组件渲染了,但无法选中(也就无法进行设置),可能原因是
TreeNodeContext.Provider
其它
具体细节,搜索几个源码就明白了,以上是我摸了些源码再加上实践总结的,请多多赐教。
另外,在 schema 结构上,子组件,是父组件属性 properties 的成员。 schema中,可直接传递这样的父子结构,供设计器使用。看源码中的 ActionsWidget,加载 localStorage中存储的schema,所以更改一下,就可加载自己其它地方的 schema。
Beta Was this translation helpful? Give feedback.
All reactions