实践是检验真理的唯一标准,只有不断的总结才会有所进步,下面总结一下我使用layui的心得和方法以及遇到的坑。
1.首先引入layui的包(从官网下载整个ui包,不要只下载layui.js和layui.css) 点击打开链接
2.html部分
<table class="layui-hide" id="test"></table>
3.js部门
layui.use(['table'], function () {
var table = layui.table;
table.render({
elem: '#test'
// , url: '/Department/ManageDeptInfo'
, method: 'POST'
, cols: [[
{ field: 'departmentName',title: '部门名称', width: 200,align:'center', sort: true }
, { field: 'departmentCode', title: '部门编号', width: 100, align: 'center', sort: true }