- yarn add vue3-print-nb
- //或
- npm install vue3-print-nb
- import { createApp } from 'vue';
- import App from './App.vue';
- const app = createApp(App);
- // 打印插件
- import print from 'vue3-print-nb'
- app.use(print)
- //
- import print from 'vue3-print-nb'
- const vPrint = print;
- const printSetting = ref({
- id: 'printMe',
- })
- "printMe">
-
-
-
为打印按钮绑定上v-print指令,值为配置变量
<div v-print="printSetting">打印div>