1.0.0 • Published 5 years ago

@mathewparet/vue-print v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@mathewparet/vue-print

A way to quickly print portion of a website.

Install

npm install @mathewparet/vue-print

Load Globally

import Print from '@mathewparet/vue-print';
Vue.use(Print);

Install in current scope

import Print from '@mathewparet/vue-print';
export default {
    components: {
        Print
    }
}

Usage

<print ref="printData">
    <h1>Hello World</h1>
    <p class="print-hidden">I am hidden during print</p>
</print>

Methods

print()

Call this method to initiate print.

this.$refs.printData.print();

Attributes

NameRequiredTypeDefaultDescription
auto-closeNoBooleantrueIf true the print popup window will close when the print dialogue closes
use-manifestNoBooleantrueIf 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-cssNoString'/css/print.css'Defnes the default print.css file.

Classes

print-hidden

Use this class for elements that shouldn't be printed.

Events

print-closed

This event is fired when print window is closed.