Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combo组件条件分支无法监听add事件 #11602

Open
jieluo19981213 opened this issue Feb 14, 2025 · 1 comment
Open

combo组件条件分支无法监听add事件 #11602

jieluo19981213 opened this issue Feb 14, 2025 · 1 comment

Comments

@jieluo19981213
Copy link

描述问题:combo里面条件分支问题

请用一段清晰简洁的文字描述问题是什么...

combo组件条件分支无法监听add事件

截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题...

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    sdknpm其他...

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在

  3. 粘贴有问题的完整 amis schema 代码:

{
"type": "page",
"body": {
"title": "",
"type": "form",
"mode": "horizontal",
"autoFocus": false,
"body": [
{
"type": "combo",
"name": "combo-conditions2",
"label": "多选",
"value": [
{
"type": "text"
}
],
"multiLine": true,
"multiple": true,
"typeSwitchable": false,
"addBtn": {
"type": "button",
"label": "增加",
"level": "default",
"block": true
},
"conditions": [
{
"label": "文本",
"test": "this.type === "text"",
"scaffold": {
"type": "text",
"label": "文本",
"name": ""
},
"items": [
{
"label": "名称",
"name": "label",
"type": "input-text"
},
{
"label": "字段名",
"name": "name",
"type": "input-text"
}
]
},
{
"label": "数字",
"test": "this.type === "number"",
"scaffold": {
"type": "number",
"label": "数字",
"name": ""
},
"items": [
{
"label": "名称",
"name": "label",
"type": "input-text"
},
{
"label": "字段名",
"name": "name",
"type": "input-text"
},
{
"label": "最小值",
"name": "min",
"type": "input-number"
},
{
"label": "最大值",
"name": "max",
"type": "input-number"
},
{
"label": "步长",
"name": "step",
"type": "input-number"
}
]
}
],
"onEvent": {
"add": {
"actions": [
{
"actionType": "toast",
"args": {
"msg": "${event.data.value|json}"
}
}
]
}
}
}
],
"submitText": null,
"actions": []
}
}

  1. 操作步骤
    请简单描述一下复现的操作步骤...
@onlyThat
Copy link

我今天遇到的这个问题
然后通过把他放在表单里面
监听表单数据变化可以监听到他的数据变化
解决了这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants