MatthewHerbst / react-to-print

Print React components in the browser. Supports Chrome, Safari, Firefox and EDGE
MIT License
2.14k stars 221 forks source link

I tried to print in the subpage under the micro-front end micro-app and found that the displayed style did not work? #630

Closed zhangqiankunai closed 1 year ago

zhangqiankunai commented 1 year ago

正常打开项目是没有问题的,挂在micro-app微前端下,打印pdf 展示的时候就发现没有css了,我要怎么解决呢,能理解我的意思吗? There is no problem to open the project normally, but when I hung it under the micro-app micro-front end, I found that there was no css when I printed the pdf display. How can I solve it? Can you understand my meaning?

zhangqiankunai commented 1 year ago

copyStyles 我怀疑是这个属性没有起作用?能不能给点建议 copyStyles I suspect this attribute is not working? Can you give me some advice

MatthewHerbst commented 1 year ago

Hello. I do not understand your problem. Could you show an example, maybe on Codesandbox?

siaikin commented 1 year ago

ReactToPrint copies the link/style in document.head. Micro-frontend frameworks may put the styles of sub-applications in shadowDOM, which will not be copied. Perhaps the printing logic can be customized through the print parameter of ReactToPrint?

zhangqiankunai commented 1 year ago

Work out