MyPrint
- Source:
Example
// 使用说明
<my-print print-range=".pring-range1">
</my-print>
// ----------或使用slot-------
<my-print print-range=".pring-range1">
<el-button type="primary" icon="el-icon-tickets" slot="button"></el-button>
</my-print>
Members
(static) props
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
String |
<optional> |
'打印'
|
按钮文字 |
type |
String |
<optional> |
'default'
|
按钮类型 |
btnClass |
String |
<optional> |
按钮样式名称 |
|
printRange |
String |
<optional> |
打印区域,css选择器,该参数为必须 |
|
containerClass |
String |
<optional> |
'my-print-page-container'
|
打印内容的容器className |
parentDom |
function | HTMLElement | String |
<optional> |
作为父容器的dom对象,或者返回dom对象的方法,dom中必须包含container-class指定的className |
|
rootStyle |
Object |
<optional> |
顶层容器的样式,请不要设置position为absolute,relative或static, 否则分页效果会不起作用 |
|
beforePrint |
function |
<optional> |
在复制打印区域前执行,须返回promise对象 |
|
afterPrint |
function |
<optional> |
在打印完成之后执行 |
|
removeSelector |
String |
<optional> |
打印时需要删除的元素选择器 |
|
styleArray |
Array |
<optional> |
打印时须改变的样式数组,示例:[{selector: '.selector', style: {height: 'auto'}}] |
|
domTransfer |
function |
<optional> |
自定义修改打印内容的方法 |
|
disableDefaultStyle |
Boolean |
<optional> |
禁用默认样式数组,只使用style-array参数 |
|
preview |
Boolean |
<optional> |
打印后不删除页面打印内容 |
属性参数
(inner) slot
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
button |
string |
<optional> |
自定义按钮 |
作用域插槽