mirror of https://github.com/layui/layui
优化 table 的 `data` 模式在未开启 `page` 时可不受 `limit` 属性限制
parent
c968ab358d
commit
cc2c14f652
|
@ -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…
Reference in New Issue