3👍
The reason why you are getting this violation warning is likely because the event handler doesn’t return until the print page is closed. So, when you click the button the print page opens, then nothing happens until the print page is closed, then the function returns.
0👍
I used onmouseover and Chrome doesn’t show the violation, but Performance say Warning.
printScreen() {
let value = this.$refs.printparts;
let printPage = window.open();
printPage.focus();
printPage.document.body.insertAdjacentHTML('afterbegin', value.outerHTML);
printPage.onmouseover = function() {
printPage.print();
printPage.close();
};
return false;
},
👤Tom
- [Vuejs]-Save data in 2 different tables with laravel
- [Vuejs]-"Cannot use import statement outside a module" got message when I try to mocha
Source:stackexchange.com