1.0.1 • Published 4 years ago

vue-perfect-print v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

vue-perfect-print

This is a simple and fast component for printing the local content of the page.

Install

npm install vue-perfect-print
import VuePerfectPrint from 'vue-perfect-print'

Vue.use(VuePerfectPrint);

Run demo

<template>
    <div>
        <button @click="print">click print</button>
    </div>
</template>

<script>
    export default {
        methods:{
            print(){
                this.perfectPrint({
                    content: "<h1>打印</h1>"
                });
            }
        }
    }
</script>

Parameter description

ParameterRequiredDescription
idfalseID of the print window
contenttruePrint content, support HTML and text
showHeaderFooterfalseDisplay page and footer, default false