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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM