## Print 局部打印
局部打印插件 $cvuPrint,可以調取打印機,以高還原度對指定的元素塊進行打印操作。
局部打印插件 $cvuPrint 是在 Vue.js 程序內使用的,它并非常規組件,而是方法的調用。任何地方,只需要一行代碼,即可對指定的元素節點進行打印。
需使用ref獲取dom節點,若直接通過id或class獲取則webpack打包部署后打印內容為空。

### 代碼示例
```javascript
<template>
<div class="page" ref="page">
<h3>基礎用法</h3>
<cvu-button type="primary" icon="md-print" @click="print">打印</cvu-button>
<h3 class="no-print">設置不打印元素</h3>
<cvu-button type="primary" icon="md-print" class="no-print" @click="print('.no-print')">打印</cvu-button>
</div>
</template>
<script>
export default {
methods: {
print(noPrint) {
this.$cvuPrint(this.$refs.page, {'noPrint': noPrint})
}
}
}
</script>
```
### methods
| 方法名 | 說明 | 參數 |
| --- | --- | --- |
| $cvuPrint | 打印方法 | el: this.$refs.xxx \-打印區域元素;<br>options:{'noPrint': '.元素類名'} \-不打印區域元素名配置 |
- 介紹
- 安裝
- 快速上手
- 組件
- 基礎
- Button 按鈕
- ButtonGroup 按鈕組
- 布局
- Card 卡片
- Col 列
- Collapse 折疊面板
- Divider 分割線
- Empty 空數據
- Row 行
- 導航
- Paginator 分頁
- PaginatorMini 分頁
- Tab 標簽頁
- 表單
- Cascader 級聯選擇
- PasswordStrength 密碼強度
- Print 局部打印
- Table 表格
- Upload 文件上傳
- 視圖
- Calendar 日歷
- Drawer 抽屜
- Loading 加載
- Message 全局提示
- Modal 對話框
- Notification 通知菜單
- Poptip 氣泡提示
- Preview 圖片預覽
- PreviewPdf pdf文件預覽
- Tooltip 文字提示
- Tree 樹形控件
- 方法
- Copy 復制到剪貼板
- DescNotice 桌面消息通知
- Html2Pdf 導出pdf
- Storage 定時存儲
- 其他
- BackTop 返回頂部
- NumberScroll 數字動畫
- NumberZero 數字前補零
- Spin 局部加載
- Tcplayer 播放器