Browse Source

fix(table): 重载时若当前页超过总页数,序号列渲染异常 (#2247)

pull/2257/head
morning-star 2 months ago committed by GitHub
parent
commit
c6f4dcc0a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      src/modules/table.js

8
src/modules/table.js

@ -1212,11 +1212,17 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
('返回的数据不符合规范,正确的成功状态码应为:"'+ response.statusName +'": '+ response.statusCode)
);
} else {
// 当前页不能超过总页数
var count = res[response.countName];
var pages = Math.ceil(count / options.limit) || 1;
if(curr > pages){
curr = pages;
}
that.totalRow = res[response.totalRowName];
that.renderData({
res: res,
curr: curr,
count: res[response.countName],
count: count,
type: opts.type
}), sort();

Loading…
Cancel
Save