<div id = "panel">
内容
</div>
printContent() {
const wpt = document.getElementById("panel");
const newContent = wpt.innerHTML;
const oldContent = document.body.innerHTML;
document.body.innerHTML = newContent;
document.getElementsByTagName("body")[0].style.zoom = 0.86; //控制打印时的缩放
window.print(); //打印方法
window.location.reload();
document.body.innerHTML = oldContent;
},