Browse Source

优化 table 的 `data` 模式在未开启 `page` 时可不受 `limit` 属性限制

pull/1210/head
贤心 2 years ago
parent
commit
cc2c14f652
  1. 9
      src/modules/table.js

9
src/modules/table.js

@ -987,10 +987,13 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
}
});
} else if(layui.type(options.data) === 'array'){ //已知数据
var res = {}
,startLimit = curr*options.limit - options.limit
var res = {};
var startLimit = curr*options.limit - options.limit;
var newData = options.data.concat();
res[response.dataName] = options.data.concat().splice(startLimit, options.limit);
res[response.dataName] = options.page
? newData.splice(startLimit, options.limit)
: newData;
res[response.countName] = options.data.length;
//记录合计行数据

Loading…
Cancel
Save