xprint
v0.2.4
Published
## install ``` npm install --save xprint ``` ```js import XPrint from 'xprint' import 'xprint/dist/vue-print.css' Vue.use(XPrint) ```
Downloads
6
Readme
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
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