Layui延时执行刷新或关闭弹窗的正确写法

115次阅读

共计 317 个字符,预计需要花费 1 分钟才能阅读完成。

搜索了很多人的解答,但基本都是这样写的:

layer.msg(d.msg,{icon:1,time:3000,shade:0.4},function() { location.href = "{:url('admin/index')}";

但是,这样写很可能执行不到,建议这样写:

done: function (res) {//console.log(res); layer.msg(res.msg, { time: 2000, end:function () {console.log('updated'); console.log('close'); parent.layer.close(index); parent.location.reload();} }); }

 

正文完
 0