layer.open弹出层的回调(返回值)

获取layer.open弹出层的返回值

layer.open({
                    type: 2,
                    title: "设置围栏",
                    shadeClose: true,
                    shade: 0.4,
                    area: ['90%', '90%'],
                    content: "/ElectronicFence/Map?id=" + id + "&shapeType=" + shapeType,
                    btn: ['确定','关闭'],
                    yes: function(index){
                        //当点击‘确定’按钮的时候,获取弹出层返回的值
                        var res = window["layui-layer-iframe" + index].callbackdata();
                        //打印返回的值,看是否有我们想返回的值。
                        console.log(res);
                        //最后关闭弹出层
                        layer.close(index);
                    },
                    cancel: function(){
                        //右上角关闭回调
                    }
                });

详情见:https://www.cnblogs.com/fjzhang/p/6232148.html

layer一款web弹层组件,其中有关于irame-父子操作可查看一下链接学习

http://layer.layui.com/?alone

posted on 2019-01-23 14:53  云点西西  阅读(9346)  评论(0编辑  收藏  举报

导航