如下是官网示例:
本地使用没有下拉项:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>debug</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link href="./layui-v2.8.11/layui/css/layui.css" rel="stylesheet">
<link href="./css/soulTable.css" rel="stylesheet" />
<style>
.layui-table-cell {
height: 25px;
line-height: 15px;
padding-left:1px;
padding-right:1px;
}
</style>
</head>
<body>
<table id="myTable" ></table>
<script type="text/html" id="toolbar">
<div><button class="layui-btn layui-btn-sm" lay-event="clearFilter">清除所有筛选条件</button></div>
</script>
<script type="text/html" id="bar">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script src="./layui-v2.8.11/layui/layui.js"></script>
<script>
layui.config({
base: 'js/ext/', // 模块目录
version: 'v1.8.0'
}).extend({ // 模块别名
soulTable: 'soulTable'
});
layui.use(['form', 'table','soulTable'], function () {
var table = layui.table,
soulTable = layui.soulTable;
// 后台分页
table.render({
elem: '#myTable'
,id: 'myTable'
,url: './data1.php'
,height: 'full-30'
,toolbar: '#toolbar'
,page: true
,limit:30
,cols: [[
{type: 'checkbox', fixed: 'left'},
{field: 'id', title: '诗词',sort: true, filter: true},
{field: 'category', title: '点赞数', filter: true, sort:true, excel:{cellType: 'n'}},
{field: 'date', title: '录入时间', filter: {type: 'date[yyyy-MM-dd HH:mm:ss]'}, sort:true},
{title: '操作', width: 156, fixed: 'right', templet: '#bar'}
]]
,done: function () {
soulTable.render(this)
}
,filter: {
bottom: false
}
});
table.on('toolbar(myTable)', function(obj){
if (obj.event === 'clearFilter') {
soulTable.clearFilter('myTable')
}
});
}, null, 'define')
</script>
</body>
</html>