0๐
I ended up trying to rephrase the problem and got to this question and answer: How to call function on child component on parent events
I gave up the whole custom event solution and simply ended up triggering the print to pdf method present in the child component from the parent, when the click event is fired.
- [Vuejs]-Dynamic background image based on javascript variable
- [Vuejs]-How to set default value in select drop down menu in html using Vue?
0๐
You can only generate PDF (printable) of the content that is being displayed on the page. What actually happens is chrome converts the view to an image that can be printed this can be done by using the window.print() function but it will not work until the content is displayed on the screen.
For generating PDF out of json data and without showing it to user, i will recoment you to check some third party libraries like jsreport
Source:stackexchange.com