npm i vue-print-nb
首先注册该插件
import Print from 'vue-print-nb'
Vue.use(Print);
使用 v-print 定义 , 点击 id 为 "myPrint" 的元素内容
<el-row type="flex" justify="end">
<el-button v-print="printObj" size="small" type="primary">打印</el-button>
</el-row>
printObj: {
id: 'myPrint'
}