fix:table paging
This commit is contained in:
@@ -470,11 +470,11 @@ export class Draw {
|
||||
let deleteStart = 0
|
||||
let deleteCount = 0
|
||||
let preTrHeight = 0
|
||||
if (trList.length > 1) {
|
||||
for (let r = 0; r < trList.length; r++) {
|
||||
const tr = trList[r]
|
||||
if (tr.tdList.length < 2) break
|
||||
if (curPagePreHeight + rowMarginHeight + preTrHeight + tr.height > height) {
|
||||
// 暂时不考虑跨列
|
||||
// 是否跨列
|
||||
if (element.colgroup?.length !== tr.tdList.length) {
|
||||
deleteCount = 0
|
||||
}
|
||||
@@ -485,6 +485,7 @@ export class Draw {
|
||||
preTrHeight += tr.height
|
||||
}
|
||||
}
|
||||
}
|
||||
if (deleteCount) {
|
||||
const cloneTrList = trList.splice(deleteStart, deleteCount)
|
||||
const cloneTrHeight = cloneTrList.reduce((pre, cur) => pre + cur.height, 0)
|
||||
|
||||
Reference in New Issue
Block a user