layui.msg 弹出时间后回调函数

12 篇文章 0 订阅
 var nowcurr = 1   //当前页
     //第一个实例
                var tableIns = table.render({
                    id: "role",
                    elem: '#demo',
                    limit: 20,
                    size: 'lg',
                    method: 'POST',
                    url: '/admin/root/roleList' //数据接口
                    ,
                    page: true //开启分页
                    ,
                    where: {
                        "token": localStorage.getItem('token'),
                    },
                    totalRow: true,
                    limits: [20, 40, 60, 80, 100],
                    limit: 1,
                    cols: [
                        [ //表头
                            {
                                field: 'roleId',
                                title: 'ID',
                                align: 'center'
                            }, {
                                field: 'name',
                                title: '用户昵称',
                                align: 'center',
                            }, {
                                field: 'desc',
                                title: '描述',
                                align: 'center',
                            }, {
                                field: 'status',
                                title: '是否启用',
                                align: 'center',
                                templet: function (d) {
                                    if (d.status == 0) { //未打卡
                                        return ' <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td>';
                                    } else {
                                        return "已打开"
                                    }
                                }
                            }, {
                                toolbar: '#bianji',
                                title: '编辑',
                                align: 'center',
                                width: 200
                            },


                        ]
                    ],
                    id: 'testReload',
                    parseData: function (res) { //res 即为原始返回的数据
                    
                    }, done: function (res, curr, count) {   //返回数据执行回调函数
                        nowcurr = curr	//设置当前页
                        layer.close(loading);    //返回数据关闭loading
                    }



                });

弹出框 一定时间之后回调 保证弹框内容能看清楚

 layer.msg(result.msg, {
     icon: 6, time: 1500, shade: 0.4
      }, function () {
          layer.closeAll();//疯狂模式,关闭所有层
          tableIns.reload({
              page: {
                  curr: nowcurr
              }
          });
      });
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值