[Vuejs]-Can't copy all the styles from the original document to implement window.print(). Localhost works fine, prod not

0๐Ÿ‘

โœ…

I found the solution. I had to put setTimeout before calling print dialog:

setTimeout(() => {
  winPrint.document.close();
  winPrint.focus();
  winPrint.print();
  winPrint.close();
 }, 500);

Now it works fine on production.

Leave a comment