效果 预期效果 //避免分页被截断async outPutPdfFn (id, title) {const _t = this;const A4_WIDTH = 592.28;const A4_HEIGHT = 841.89;// dom的id。let target = document.getElementById('pdf');let pageHeight = target.scrollWidth / A4_WIDTH * A4_HEIGHT;// 获取分割dom,此处为class类名为item的domlet lableListID = document.getElementsByClassName('item');// 进行分割操作,当dom内容已超出a4的高度,则将该dom前插入一个空dom,把他挤下去,分割for (let i = 0; i < lableListID.length; i++) {const currentItem = lableListID[i];let elToTop = document.getElementById('title').offsetTop + currentItem.offsetTopif (elToTop + currentItem.offsetHeight > pageHeight && elToTop < pageHeight) {let divParent = currentItem.parentNode; // 获取该div的父节点let newNode = document.createElement('div');newNode.className = 'emptyDiv';newNode.style.height = 8 + 'px';newNode.style.width = '100%';divParent.insertBefore(newNode, currentItem);}}await _t.$nextTick();_t.getPdf({id,title,backgroundColor: '#fff'}).then(base64 => {uni.postMessage({data: {pb: base64,name: title}})_t.navigateBack();})},