版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
Layui超实用10篇技术解决方案:https://blog.csdn.net/libusi001/article/details/100065911
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
参数释义:
table.render({
elem: '#test'
, url: ctxPath + 'jarInfo/select'
, toolbar: '#toolbarDemo' //工具栏
, title: 'Jar包基本信息'
,skin: 'row' //表格风格
, cellMinWidth: 200
, cols: [//标题栏
[
{title: 'ID', fixed: 'left', width: 80, unresize: true, type: 'numbers'},
{field: 'id', width: 120, fixed: 'left', hide: true},
{field: 'name', width: 350, title: '文件名', align: 'left'},
{field: 'groupId', title: '组织机构', align: 'center'},
{field: 'artifactId', title: '项目/库', align: 'center'},
{field: 'version', title: '唯一发行版本号', align: 'center'},
{field: 'ifDanger', title: '是否存在风险', align: 'center'},
{
field: 'jarStatus', title: '状态', align: 'center', templet: function (res) {
let status = res.jarStatus;
if (status === 0) {
return "开源";
} else if (status === 1) {
return "封装";
}
}
}
, {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 200}
]
]
, page: true //是否显示分页
, limit: 15 //默认分页条数
, limits: [15, 30, 50] //自定义分页数据选项
, id: 'reload' //用于绑定模糊查询条件等等
, done:function(res){
var data = res.data;
}
, loading: false //请求数据时,是否显示loading
});
有用请点赞,养成良好习惯!
疑问、交流、鼓励请留言!