今天一个新需求,前端需要调用浏览器的打印工具
开始有点不知所措后来百度一看好像不是很难直接调用一个 vue插件就行 **
vue-print-nb**
所以就浅浅的记录一下
1.引入插件 npm install vue-print-nb --save
2.在main.js中引入
3.import Print from 'vue-print-nb'
4.Vue.use(Print)
<el-col :span="12" v-if="type !== 'add'">
<el-form-item label="二维码:">
<!-- <el-button
type="primary"
@click="getQrCode"
v-if="!readonly"
style="vertical-align: top"
>生成</el-button
> -->
// img图片必须要有一个唯一的id
// v-print="'#printqrcode'" 绑定id
<el-image id="printqrcode" :src="formData.indexN