3👍
Looks like you are using the wrong id. Did you mean to use print-form
instead?
printJS({
printable: "print-form",
type: "HTML"
});
- [Vuejs]-How to add new css file from node module
- [Vuejs]-Vuex-map-fields updating multiple stores through modules
2👍
I can propose you this solution:
@media print {
body * {
visibility: hidden;
}
#targetDiv, #targetDiv * {
visibility: visible; border: none;
}
}
<!DOCTYPE html>
<html>
<body>
<h2>The window.print() Method</h2>
<div>
<p>Click the button to print the current page.</p>
</div>
<div id="targetDiv">
<p>Lorem ipsum kjng kq fev lnb fesl</p>
</div>
<button onclick="window.print()">Print this page</button>
</body>
</html>
Source:stackexchange.com