Vue HTML to Paper is a Vue mixin for printing paper for HTML elements.
Must Read: jQuery Animate Overlay That Makes You Scroll Between HTML Elements
How to make use of it:
1. Import and install the vue-html-to-paper component.
import Vue from 'vue'; import VueHtmlToPaper from 'vue-html-to-paper';
2. Register the component.
Vue.use(VueHtmlToPaper, options); // or using the defaults with no stylesheet Vue.use(VueHtmlToPaper);
3. In your application form:
<template> <div> <!-- SOURCE --> <div id="printMe"> <h1>Print me!</h1> </div> <!-- OUTPUT --> <button @click="print"></button> </div> <template> <script> export default { data () { return { output: null } }, methods: { print () { // Pass the element id here this.$htmlToPaper('printMe'); } } } </script>
4. Possible options.
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' ] }
See Also –
Animated Test Tube Works With CSS and HTML Elements
HTML View Select Element As a Grid with Clickable Elements | Grid Picker
JavaScript Library for Nested Accordions using Custom Elements
See Demo And Download
Official Website(mycurelabs): Click Here
This superior jQuery/javascript plugin is developed by mycurelabs. For extra Advanced Usage, please go to the official website.