A way to quickly print portion of a website.
npm install @mathewparet/vue-print
import Print from '@mathewparet/vue-print';
Vue.use(Print);
import Print from '@mathewparet/vue-print';
export default {
components: {
Print
}
}
<print ref="printData">
<h1>Hello World</h1>
<p class="print-hidden">I am hidden during print</p>
</print>
Call this method to initiate print.
this.$refs.printData.print();
Name | Required | Type | Default | Description |
---|---|---|---|---|
auto-close |
No | Boolean | true |
If true the print popup window will close when the print dialogue closes |
use-manifest |
No | Boolean | true |
If true the /mix-manifest.json file is called to identify the latest print-css file. If no manifest is found, it falls back to use the print-css file without version |
print-css |
No | String | '/css/print.css' |
Defnes the default print.css file. |
print-hidden
Use this class for elements that shouldn't be printed.
This event is fired when print window is closed.