Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference HTML file in iframe with Quasar framework

I need to open an static HTML file inside an iframe because I need it to be printed silently, I’m trying setting the iframe src with absolete and relative paths but none of them work, I’ve tried moving my files inside public, static and assets folders with no success, I’ve seen that some people uses process.env.BASE_URL to access absole path of environment but it doesn’t work in Quasar.

Currently I have my files in a folder called ticketTemplates inside public folder placed at root, and it has two files: first.html and first.css, I’m doing the following:

<iframe src="ticketTemplates/first.html" frameborder="1"></iframe>

But as I said before it does not with relative or absolute paths. I've tried with http://localhost:8080/ticketTemplates/first.html too and it does not work.

Could you tell me how to achieve it?

like image 522
Jonathan Arias Avatar asked May 20 '26 18:05

Jonathan Arias


1 Answers

I opened this tread in Quasar Forum and I found I was using an outdated version of @quasar/app, I updated my project and the content worked inside my iframe. I moved my ticketTemplates folder inside public folder located in root directory, next to quasar.conf.js file and the resulting code was:

<iframe src="http://localhost:8080/ticketTemplates/first.html" frameborder="1"></iframe>

All the credit goes to the user who helped me.

like image 117
Jonathan Arias Avatar answered May 22 '26 22:05

Jonathan Arias