amis 多级弹窗场景可以打开子弹窗的同时关闭父级弹窗吗?

u0njafvf  于 4个月前  发布在  其他
关注(0)|答案(7)|浏览(105)

多级弹窗场景可以打开子弹窗的同时关闭父级弹窗吗?

sycxhyv7

sycxhyv72#

@xiahao90 请问如何配置呢?我尝试过多次,如果给父级弹窗设置了提交后关闭,且提交后打开子弹窗,实际效果总是子弹窗打开后会马上跟父级弹窗一起闪退。谢谢指导!

m1m5dgzv

m1m5dgzv4#

@xiahao90 我的需求不是关闭多个,而是打开子弹窗之前关闭父弹窗,一关一开的效果。现在默认是多级弹窗都只能同时打开。

holgip5t

holgip5t5#

你在关闭弹框动作加个componetID,填上弹框id就可以了

k0pti3hp

k0pti3hp6#

你在关闭弹框动作加个componetID,填上弹框id就可以了

试过了。还是不行

gorkyyrv

gorkyyrv7#

@ziBLan 这是可以复现问题的schema源码:

{
  "type": "page",
  "title": "多级弹窗bug复现",
  "body": [
    {
      "type": "button",
      "label": "点我",
      "actionType": "dialog",
      "level": "primary",
      "dialog": {
        "type": "dialog",
        "title": "一级弹窗",
        "body": [
          {
            "type": "button",
            "label": "按钮",
            "onEvent": {
              "click": {
                "actions": [
                  {
                    "ignoreError": false,
                    "actionType": "closeDialog",
                    "componentId": "u:e87f1cb48b19"
                  },
                  {
                    "ignoreError": false,
                    "actionType": "dialog",
                    "dialog": {
                      "type": "dialog",
                      "title": "二级弹窗",
                      "body": [
                        {
                          "type": "tpl",
                          "tpl": "弹窗内容",
                          "id": "u:6a2533606314"
                        }
                      ],
                      "id": "u:bee964d7f84d",
                      "actions": [
                        {
                          "type": "button",
                          "actionType": "cancel",
                          "label": "取消",
                          "id": "u:c842c40f0212"
                        },
                        {
                          "type": "button",
                          "actionType": "confirm",
                          "label": "确定",
                          "primary": true,
                          "id": "u:bfcb369de48d"
                        }
                      ],
                      "actionType": "dialog",
                      "showCloseButton": true,
                      "closeOnOutside": false,
                      "closeOnEsc": false,
                      "showErrorMsg": true,
                      "showLoading": true,
                      "draggable": false
                    }
                  }
                ]
              }
            },
            "id": "u:62b33e843d58"
          }
        ],
        "size": "lg",
        "actions": [
          {
            "type": "button",
            "actionType": "cancel",
            "label": "取消",
            "id": "u:5d01cdee8412"
          },
          {
            "type": "button",
            "actionType": "confirm",
            "label": "确定",
            "primary": true,
            "id": "u:15e9b062157d",
            "onEvent": {
              "click": {
                "weight": 0,
                "actions": []
              }
            }
          }
        ],
        "id": "u:e87f1cb48b19",
        "actionType": "dialog",
        "showCloseButton": true,
        "closeOnOutside": false,
        "closeOnEsc": false,
        "showErrorMsg": true,
        "showLoading": true,
        "draggable": false
      },
      "id": "u:db2f03aac008"
    }
  ],
  "asideResizor": true,
  "pullRefresh": {
    "disabled": true
  },
  "id": "u:6431be9d53ef",
  "definitions": {}
}

我把关闭本级弹窗和打开二级弹窗的两个action调换顺序也不行。

相关问题