baidu/amis

iframe的通信事件多次响应问题

Closed this issue · 1 comments

描述问题:

dialog内添加了iframe,iframe添加了通信事件,每次重新打开dialog后,iframe绑定的通信事件就会重复绑定,导致通信事件被多次响应

截图或视频:

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

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

  1. 你是如何使用 amis 的?
    sdk

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

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

{
  "type": "page",
  "data": {
    "iframeSrc": "https://github.com/baidu/amis"
  },
  "body": [
    {
      "type": "button",
      "actionType": "dialog",
      "dialog": {
        "title":"adf",
        "body":[
          {
            "type": "iframe",
            "src": "http://www.xxx.com",
            "onEvent": {
              "detail": {
                "actions": [
                  {
                    "actionType": "crud",
                    "componentId": "form01",
                    "data": {
                      "iframeId": "${iframeId}" // 刷新请求参数为`"iframe 传给 amis 的 id 是:${iframeId}"`这段模板,即111
                    }
                  }
                ]
              }
            }
          }
        ]
      }
    }
  ]
  1. 操作步骤
    请简单描述一下复现的操作步骤...

感谢反馈已定位到问题