I want to print some content from a vue component. For example from the following snippet, I would like to print the v-card-text
element which also has an id of
Install this package vue-html-to-paper
npm install vue-html-to-paper
usage:
import Vue from 'vue';
import VueHtmlToPaper from 'vue-html-to-paper';
const options = {
name: '_blank',
specs: [
'fullscreen=yes',
'titlebar=yes',
'scrollbars=yes'
],
styles: [
'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css',
'https://unpkg.com/kidlat-css/css/kidlat.css'
]
}
Vue.use(VueHtmlToPaper, options);
// or, using the defaults with no stylesheet
Vue.use(VueHtmlToPaper);
component:
Print me!
for more detail check: https://randomcodetips.com/vue-html-to-paper/