vue頁面實現區域性列印
阿新 • • 發佈:2020-12-19
將要列印的 html 塊加上 id,然後將下面的 print 換成 html 塊的 id 即可!
let subOutputRankPrint = document.getElementById("print");
let newContent = subOutputRankPrint.innerHTML;
let oldContent = document.body.innerHTML;
document.body.innerHTML = newContent;
window.print();
window.location. reload();
document.body.innerHTML = oldContent;