关于layer.open弹窗,项目中使用了这样的功能。就是在弹窗中操作完成后点击保存(提交),然后弹窗不关闭,只是刷新弹窗,然后继续操作。实现方式其实很简单,就一行代码
document.getElementById("layui-layer-iframe"+index).contentWindow.location.reload();
具体如下:
layer.open({
type : 2,
content: '',
area : ['500px', '500px'],
title : '刷新弹窗',
btn:['提交', '取消'],
yes : function (index, layero) {
document.getElementById("layui-layer-iframe"+index).contentWindow.location.reload();
},
btn2:function (index, layero) {
},
上述代码即可实现刷新弹窗。