You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>test</title>
|
|
<!-- layui -->
|
|
<link rel="stylesheet" href="../public/layui/css/layui.css">
|
|
<script src="../public/layui/layui.js"></script>
|
|
<style>
|
|
.layui-table{
|
|
margin-top: 0px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<table id="demo" lay-filter="test">
|
|
|
|
</table>
|
|
<script type="text/html" id="operate">
|
|
<button type="button" class="layui-btn layui-btn-warm">编辑</button>
|
|
<button type="button" class="layui-btn layui-btn-danger">删除</button>
|
|
</script>
|
|
<script>
|
|
layui.use('table', function(){
|
|
var table = layui.table;
|
|
|
|
//第一个实例
|
|
table.render({
|
|
elem: '#demo'
|
|
,height: 600
|
|
//,url: './data.json' //数据接口
|
|
,url: './bookList'
|
|
,page: true //开启分页
|
|
,size: 'lg'
|
|
,cols: [[ //表头
|
|
{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
|
|
,{field: 'name', title: '书名', width:120}
|
|
,{field: 'library_name', title: '图书馆', width:80}
|
|
,{field: 'sort_id', title: '分类', width: 177}
|
|
,{field: 'position_id', title: '位置', width: 80, sort: true}
|
|
,{field: 'state', title: '状态', width: 80, sort: true}
|
|
,{field: 'descript', title: '描述', width: 80}
|
|
,{field: 'operate', title: '操作', width: 200, templet: '#operate'}
|
|
]]
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
</table>
|
|
</body>
|
|
</html> |