你可以使用inputType "container "将多个输入字段分组。
这使得配置面板在视觉上更加清晰,因为它把可以配置的不同方面分开。例如,一个组可以包含UI配置选项(标题、按钮、图像),而另一个组则是配置你的组件的实际功能。
同时,分组功能带有允许用户复制一组元素的选项,从而创造了配置动态数量的可配置元素的选项。
其中一些具体的属性是。
- 容器组。使 用这个属性来区分不同类型的组。然后在工作流标记中迭代容器时可以使用这个属性
- 可重复。 使得用户能够创建一个组的副本,然后可以单独更改。这样你就可以实现可重复的元素
- 可折叠的。 是否应该可以从配置中移除容器。对复制的容器自动设置(见可重复),不应该用于基本容器。
- 可编辑。 是否应该可以改变容器的标题
"base_sensor": {
"title": "Sensor 1",
"inputType": "container",
"containerGroup": "sensors",
"repeatable": true,
"collapsible": true,
"deleteable": false,
"editable": true,
"value": {
"sensor_shown": {
"title": "Value Shown",
"inputType": "checkbox-input",
"value": false,
"showIfComputed": true
},
"sensor_type": {
"inputType": "file-upload",
"title": "Icon",
"accept": "image/png",
"multiple": false,
"value": "",
"showIfComputed": true
},
"sensor_unit": {
"title": "Unit",
"inputType": "textinput",
"value": "rpm",
"showIfComputed": true
},
"sensor_json_path": {
"title": "JSON Path ",
"inputType": "textinput",
"value": "rpm",
"showIfComputed": true
}
},
"showIfComputed": true,
"container_editing": false,
"container_opened": true
}