amis
amis copied to clipboard
amis-editor中自定义combo plugin,右侧面板中的select选中事件如何能修改combo的内容?
实现场景:
在amis-editor中,我实现了一个自定义combo组件,combo组件右侧面板中带有一个数据源下拉框,当下拉框修改触发change事件时,将自定义combo组件的items修改为我选择的选项值
存在的问题:
没有找到方法实现
当前方案:
请粘贴你当前方案的完整 amis schema 代码...
panelBodyCreator中的配置:
getSchemaTpl('select', {
required: true,
label: tipedLabel('字段名称', '必填:可从已配置好的子表名称中选择一个,如果需要增加子表名称,请在管理后台表单数据源<span style="color:orange">子表名称</span>中增加'),
name: 'name',
type: 'select',
searchable: true,
source: '/api/form/formDataSource/list?code=form_sub_table_name',
"onEvent": {
"change": {
"actions": [
{
"actionType": "setValue",
"componentId": "title",
"args": {
"value": "${event.data.selectedItems.label}"
}
},
{
"actionType": "setValue",
"componentId": "label",
"args": {
"value": "${event.data.selectedItems.label}"
}
},
{
"actionType": "想要在这里改变组件的items值",
}
]
}
},
}),
👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.