D
D
Dmitry2021-01-15 07:05:05
Vue.js
Dmitry, 2021-01-15 07:05:05

How to print the form or is it more appropriate to create a separate vue component?

Faced here with what problem. It is necessary to implement the functionality of printing the application. But at this stage, the questionnaire is implemented in the form of a form - with inputs. And accordingly vue-html-to-paper does not see data from v-model. I found a couple more Chinese directives - they also do not see dynamic data. The feeling that the function is called before rendering.
What is the best way to implement it? Make a separate component with styles and stuff. Pass the object there, put the data in its place, and call print in the mounted hook?
I was sure that this was nonsense and left it for later, but now I can’t immediately implement it. window.print prints the entire page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2021-01-15
@rpsv

Output the print call through window.print, and the rest of the styles are implemented through CSS:
@media print { /* Стиль для печати */ }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question