The effect is as follows:
Add loading icon before data table rendering
var index = layer.load(2); //添加loading,0-2三种方式
Among them, there are three styles of loading icons, as shown below:
Add done to the layui data table, the callback after the data table is rendered, please refer to the official document: https://www.layui.com/doc/modules/table.html#done
,done:function (res) { //返回数据执行回调函数
layer.close(index); //返回数据关闭loading
}