先定义tablename
var table_name = table.render({});
然后用tablename来获取
var layui_page = table_name.config.page.pages;
如果点击下一页,表格重载之后需要获取,就把获取的代码放在那一步操作里就可以了,例如
//监听工具条table.on('tool(layuiTable)', function(obj){var data = obj.data;if(obj.event === 'edit'){console.log(table_name.config.page.pages);window.location.href = "/index.php/admin/good/edit_good?id="+data.id;} else if(obj.event === 'del'){//代码}});