把数据行的LAY_CHECKED设置为true
var rowsToSelect = [11,22];//需要默认选中的行id data.forEach(item=>{if(rowsToSelect.includes(item.id)){item.LAY_CHECKED=true;} }); // 渲染表格 table.render({elem: '#batchWarehousePackTable',id:'batchWarehousePackTable',cols: [[{type: "checkbox",width: 30}, {field: 'purBaseNum', title: `采购基数<span style="color:red;font-size:12px;">(注意采购基数的影响!)</span>`,width:120},{field: 'note', title: `<div>下单备注<i id="delNote" class="layui-icon layui-icon-delete" style="color:red;font-size:30px;" lay-tips="对已勾选的SKU的下单备注清空!"></i></div>`,templet:"#noteTpl",width:350},]],data: res,height:502,page: false,limit:9999, });