amis icon indicating copy to clipboard operation
amis copied to clipboard

iframe回传变量外部无法使用

Open chenyphaaa opened this issue 5 years ago • 1 comments

实现场景:

使用iframe回传的变量值,可以正常弹出对话框显示,但是form表单中flow没有值

存在的问题:

使用iframe回传的变量值,iframe外部无法使用

当前方案:

{
  "type": "page",
  "body": {
    "type": "form",
    "controls": [
      {
        "type": "text",
        "name": "name",
        "label": "名字"
      },
      {
        "type": "text",
        "name": "description",
        "label": "描述"
      },
      {
        "type": "text",
        "name": "flow",
        "label": "flow"
      },
      {
        "type": "iframe",
        "name": "flow",
        "className": "flow_chart",
        "src": "xx/flow.html",
        "events": {
          "detail": {
            "actionType": "dialog",
            "dialog": {
              "title": "弹框",
              "body": "${flow}"
            }
          }
        },
        "height": "100%"
      }
    ]
  }
}

chenyphaaa avatar Jun 21 '21 03:06 chenyphaaa

看文档,用 postMessage

nwind avatar Oct 28 '21 07:10 nwind