xprint

0.2.4 • Public • Published

xprint

install

npm install --save xprint
import XPrint from 'xprint'
import 'xprint/dist/vue-print.css'
Vue.use(XPrint)

config

import XPrint from 'xprint'
import 'xprint/dist/vue-print.css'
Vue.use(XPrint, {
  beforePrint() { // 打印前
    document.body.style.backgroundColor = '#f00'
  },
  afterPrint() { // 打印后
    document.body.style.backgroundColor = '#0ff'
  }
})

use

  <xpage class="page"></xpage>
  <xpage class="page" white></xpage>

methods

// vue prototype $xprint methods(window.print())
vm.$xprint()

demo

github npm

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your tests

npm run test

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

Readme

Keywords

none

Package Sidebar

Install

npm i xprint

Weekly Downloads

7

Version

0.2.4

License

ISC

Unpacked Size

695 kB

Total Files

20

Last publish

Collaborators

  • sincerity