<div id="printPage">Print the content</div>
<button class="btn-common btn-search" @click="btn_sendmsg" id="print-btn">print</button>
Copy the code
var newstr = document.getElementById("printPage").innerHTML;// The id you want to print
var oldstr = document.body.innerHTML;
document.body.innerHTML = newstr;
window.print();
Copy the code
That will do