代码如下:
javascript
//显示表个数据
table.render({
elem: '#' + tableId
, height: 350
, page: false // 开启分页
, skin: 'row' // 行边框风格
, even: true // 开启隔行背景
, defaultToolbar: ['filter']
, toolbar: '#active' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
, cols: [[
{field: 'id', title: 'ID', hide: true},
{field: 'warehouseName', title: '库位', align: 'center', minWidth: 150},
{field: 'warehouseReleaseDate', title: '预约出仓日期', align: 'center', width: 300},
{fixed: 'right', title: '操作', align: 'center', toolbar: '#action', width: 150}
]],
data: tableData,
});
测试中,发现tableData数据大于10条时,表格依然只展示10条数据。后面查layui文档,才发现即是设置page为false时,外面的limit参数依然生效。

解决方法
增加limit配置即可。
javascript
//显示表个数据
table.render({
elem: '#' + tableId
, height: 350
, page: false // 开启分页
, skin: 'row' // 行边框风格
, even: true // 开启隔行背景
, defaultToolbar: ['filter']
, toolbar: '#active' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
, cols: [[
{field: 'id', title: 'ID', hide: true},
{field: 'warehouseName', title: '库位', align: 'center', minWidth: 150},
{field: 'warehouseReleaseDate', title: '预约出仓日期', align: 'center', width: 300},
{fixed: 'right', title: '操作', align: 'center', toolbar: '#action', width: 150}
]],
data: tableData,
limit: tableData.length
});