1. layui.open原生是通过get提交数据的:
var url = "/train/class/stage?" + jQuery.param(stage);
window.layerIndex = layer.open({
type: 2,
title: "编辑阶段",
shadeClose: true,
maxmin: true,
area: size,
content: [url, 'on'],
btn: ['确定','关闭'],
yes: function(index){
var res = window["layui-layer-iframe" + index].callbackdata();
layer.close(index);
},
cancel: function(){
//右上角关闭回调
}
});
2. layui.open通过post提交打开弹层:
参考链接:https://blog.csdn.net/u011752272/article/details/77097663
$.ajax({
type: 'POST',
url: url,//发送请求
data: stage,
dataType: "html",
success: function (result) {
var htmlCont = result;//返回的结果页面
layer.open({
type: 1,//弹出框类型
title: "编辑阶段",
shadeClose: true,
maxmin: true,
area: size,
content: htmlCont,//将结果页面放入layer弹出层中
btn: ['确定','关闭'],
yes: function(index){
var res = window["layui-layer-iframe" + index].callbackdata();
layer.close(index);
},
});
}
});