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

【必现Bug】事件动作顺序执行时,ignoreError: false 当前执行的事件出现错误时无法中断后续事件的执行 #11457

Open
sforcp opened this issue Jan 7, 2025 · 4 comments
Labels
bug Something isn't working doc optimizing document need confirm

Comments

@sforcp
Copy link

sforcp commented Jan 7, 2025

描述问题:

点击按钮触发多个事件顺序执行,将 ignoreError 设为 false,当事件出现异常错误时,无法中断后续事件的执行。官方提供的demo也无法中断

截图或视频:

参考Demo页: https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/event-action#%E5%BF%BD%E7%95%A5%E5%8A%A8%E4%BD%9C%E6%8A%A5%E9%94%99%E7%BB%A7%E7%BB%AD%E6%89%A7%E8%A1%8C
image

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

  1. 你是如何使用 amis 的?
    在amis的官方示例上就有问题,参考“截图或视频”中的链接和截图

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

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

{
  "type": "page",
  "title": "第一个按钮发生错误直接阻塞执行,第二个按钮发生错误后仍然执行",
  "body": [
    {
      "type": "button",
      "label": "无法弹出提示",
      "level": "primary",
      "className": "mr-2",
      "onEvent": {
        "click": {
          "actions": [
            {
              "actionType": "reload",
              "componentId": "notfound"
            },
            {
              "actionType": "toast",
              "args": {
                "msg": "okk"
              }
            }
          ]
        }
      }
    },
    {
      "type": "button",
      "label": "可以弹出提示",
      "level": "primary",
      "onEvent": {
        "click": {
          "actions": [
            {
              "actionType": "reload",
              "componentId": "notfound",
              "ignoreError": true
            },
            {
              "actionType": "toast",
              "args": {
                "msg": "okk"
              }
            }
          ]
        }
      }
    }
  ]
}
  1. 操作步骤
    【必现】
    第一步:打开链接
    https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/event-action#%E5%BF%BD%E7%95%A5%E5%8A%A8%E4%BD%9C%E6%8A%A5%E9%94%99%E7%BB%A7%E7%BB%AD%E6%89%A7%E8%A1%8C
    第二步:找到目录: 忽略动作报错继续执行
    第三步:点击“无法弹出提示”按钮
@github-actions github-actions bot added bug Something isn't working doc optimizing document labels Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@sforcp
Copy link
Author

sforcp commented Jan 9, 2025

有进展了吗?

@lhtuling
Copy link

示例代码有问题,
默认应该是忽略,手动修改成不忽略就可以了!

          "ignoreError": false

Amis低代码前端框架交流群【QQ 1群】:717791727
Amis低代码前端框架交流群【QQ 2群】:721182449

@sforcp
Copy link
Author

sforcp commented Jan 10, 2025

配置了 "ignoreError": false,不起作用,通过配置界面配置按钮点击事件
1、第一个场景
image
2、第二个场景
image

界面的 ignoreError 配置
image
代码的 ignoreError 配置
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working doc optimizing document need confirm
Projects
None yet
Development

No branches or pull requests

2 participants