插件下载地址(免费):https://download.youkuaiyun.com/download/qaakd/20722161
1.在main.js文件里加上:
import Print from '@/store/print'
Vue.use(Print) // 注册在线打印功能插件
2.页面中调用:
<template>
<section ref="print">
打印内容
<div class="no-print">不要打印我</div>
</section>
</template>
this.$print(this.$refs.print) // 使用

本文介绍了如何在Vue项目中通过导入并注册Print插件,实现在页面中调用在线打印功能。步骤包括在main.js中引入插件并启用,以及在模板中正确调用。
1987

被折叠的 条评论
为什么被折叠?



