Closed PachVerb closed 3 years ago
As this guy said#47 -Bopsi, a new window will send a new request to the server, so where does the request go? Why does the style file, which is in the public directory, work properly? Maybe this is a different question from others. But that's what I'm focused on. @jofftiquez
VueHtmlToPaper opens a new window with its own style tag. So when you pass a CDN it works, if u pass a local file it does not because it tries to access the resource in your web server but in the wrong URL. Let's see how the page looks when we use a CDN and a local CSS file.
CDN
Local CSS file
And let's say you are calling the print function from
http://localhost:8080/somepage
This will try to open
http://localhost:8080/somepage/myPrint.css
. Obviously this will not be accessible to print dialogue.Solution
Sample Option
Also, the simplest way to access root-relative path is to use
/
. User/style.css
instead of./style.css
Originally posted by @Bopsi in https://github.com/mycurelabs/vue-html-to-paper/issues/47#issuecomment-682530153