[Vuejs]-Printing Page Section using PrintJS on vueJS

3👍

Looks like you are using the wrong id. Did you mean to use print-form instead?

       printJS({
         printable: "print-form",
         type: "HTML"
       });

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>

Leave a comment