安裝依賴
npm install print-js --save
頁(yè)面引入
import print from 'print-js'
打印按鈕
<el-button type="primary" v-if="itemList.length>0" @click="printSomething">打印</el-button>
打印的內(nèi)容
使用
不想要打印的內(nèi)容加上水印圖片 刪除這塊內(nèi)容
<p class="titleImg"> <img class="titleLogo" src="@/assets/logo/printLogo.jpg" alt=""></p>?