|
|
@@ -254,20 +254,17 @@ export default {
|
|
|
// // 确保克隆的DOM保持原始样式
|
|
|
// clonedDoc.getElementById('html2canvas').style.overflow = 'auto';
|
|
|
// },
|
|
|
- // ignoreElements: (element) => {
|
|
|
- // // 保留目标元素及其祖先/后代节点(维持层级结构)
|
|
|
- // if (targetElement.contains(element) || element.contains(targetElement)) {
|
|
|
+ // ignoreElements: (e) => {
|
|
|
+ // if (
|
|
|
+ // e.contains(element) ||
|
|
|
+ // element.contains(e) ||
|
|
|
+ // e.tagName === 'STYLE' ||
|
|
|
+ // e.tagName === 'LINK' ||
|
|
|
+ // e.getAttribute('data-html2canvas') != null // header里面的样式不能筛掉
|
|
|
+ // ) {
|
|
|
+ // console.log(e);
|
|
|
// return false;
|
|
|
// }
|
|
|
- // // 保留样式标签(避免截图样式丢失)
|
|
|
- // if (element.tagName === 'STYLE' || element.tagName === 'LINK') {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // // 保留标记 data-html2canvas 的节点(如头部样式)
|
|
|
- // if (element.getAttribute('data-html2canvas') !== null) {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // // 其余节点全部忽略
|
|
|
// return true;
|
|
|
// },
|
|
|
})
|