layui
layui的渲染方式
- 用的最多的是访问url,之后会将数据渲染到表格中。。
1
2
3
4
5
6
7
8
9
10
11
12table.render({
elem: '#demo'
,height: 312
,url: '../../demo/table/user/-page=1&limit=30.js' //数据接口
,page: true //开启分页
,cols: [[ //表头
{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
,{field: 'username', title: '用户名', width:80}
,{field: 'sex', title: '性别', width:80, sort: true}
,{field: 'city', title: '城市', width:80}
]]
});
layui
http://example.com/2022/11/05/layui/