介绍

element-easy-print

element-easy-print 是一个基于 ElementPlus 的表单组件,可以通过JSON快速的生打印模板。

演示地址open in new window

安装
element-easy-print
^1.0.4

npm install element-easy-print --save
1

引入

import ElementEasyPrint from "element-easy-print";
import "element-easy-print/dist/style.css";
Vue.use(ElementEasyPrint)
1
2
3

EasyPrint 或 Preview 属性

属性名说明数据类型默认值
options渲染数据Object参考在线案例
datasource传入字段数据Object参考在线案例
richTextContent富文本组件Object参考在线案例
webViewLoadingTimewebview加载时间用来防止打印没数据问题number4000ms

富文本注意事项

想使用富文本功能必须自己封装一个。 严格按照案例封装方式进行封装 v-model change事件 都要有 change 返回值就是html内容

element-easy-print 方法

方法名说明返回值
handleSave返回当前JSON数据options
handlePreview预览方法boolean, options

需要打印驱动 联系 QQ: 229236940