1. Background of the problem:
2. Causes of the problem:The document may have been manipulated but not destroyed (maybe) 3. Problem solving:Eliminate the document of the operation
//The method parameter content: the element to be printed printFun = (content) => { var Window = window.open("", "Print Page", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no"); var style = "<style type='text/css'></style>"; Window.document.write(content + style); Window.focus(); Window.document.close(); //Close the output stream of the document and display the selected data Window.print(); //Print the current window return Window; }
var windows = this.print(document.getElementById('billDetails').innerHTML); windows.close(); Summarize:
This is the end of this article about how to solve the problem of page unresponsiveness when using window.print() in React. For more related content about page unresponsiveness when using window.print() in React, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! |
<<: CSS Tutorial: CSS Attribute Media Type
>>: Nginx implements high availability cluster construction (Keepalived+Haproxy+Nginx)
The insignificant flex-basis has caused a lot of ...
At first, I wanted to modify the browser scroll b...
Preface Due to the weak typing of JS, loose writi...
Table of contents Preface start Basic layout Data...
Today, the company project needs to configure doc...
Background Here's what happened, Luzhu accide...
Development Trends: html (Hypertext Markup Languag...
The use of ElementUI paging component Pagination ...
1. mpstat command 1.1 Command Format mpstat [ -A ...
Overview I believe we often encounter such scenar...
The previous article wrote about how to manually ...
In Vue, we generally have front-end and back-end ...
webpack loads css files and its configuration Aft...
Preface MySQL is a relational database with stron...
1. Modify my.cnf #The overall effect is that both...