alibaba / alibaba/lowcode-engine
拖拽实现的表单项目,根据表单上下文显示隐藏,类似antd shouldUpdate
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
## 复现截图
问题截图如下,希望通过某途径根据form的字段变化动态显示隐藏。
## 复现流程与链接
[demo antd 高级组件 + formily 表单组件](http://localhost:5556/antd-pro-with-formily.html)场景下,物料搜索“表单”,拖拽进渲染器内,然后将“开关表单项”(后称“开关”)下方的一个表单项作为需要隐藏的表单项(后成为“隐藏项”)

然后选中隐藏项,高级设置内“是否渲染”选择条件渲染,然后输入如下:

预览时“开关”项,(意料之内不会展示出来“隐藏项”)并未监听到变化。
## 期望结果
有一种方式可以解决这个问题,设置个state并监听“开关”的状态,然后将“隐藏项”显隐条件绑定给该state。感觉这种方式后面复杂表单就麻烦了。
个人觉得比较舒适的状态是,直接通过某种途径绑定表单项变化。[antd shouldUpdate](https://ant.design/components/form-cn/#shouldUpdate)
## 环境信息
- 引擎版本 1.0.11
- ext 版本 1.0.3
- 物料
- moment﹫2.24.0
- lodash
- iconfont-icons
- ﹫ant-design/icons﹫4.7.0
- antd﹫4.19.5
- ﹫alifd/next﹫1.24.18
- ﹫alilc/antd-lowcode-materials﹫1.0.6
- ﹫seada/antd-materials﹫0.1.1
- ﹫seada/formily-materials﹫0.1.1
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked antd + formily demo and the advanced settings flow for conditional rendering. Trace how form field changes reach the hidden item's visibility condition, then verify that changing the switch field updates the hidden item during preview without requiring a separate state; no source files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100