npm.io
0.2.4 • Published 7 years ago

xprint

Licence
ISC
Version
0.2.4
Deps
1
Size
679 kB
Vulns
1
Weekly
0

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.