From b1e2b51f0f84d5552f2882c5fe9ae979c9478964 Mon Sep 17 00:00:00 2001 From: qq_38870145 Date: Sun, 26 May 2024 20:26:13 +0800 Subject: [PATCH] Auto Commit --- index.html | 4 +- package.json | 3 +- src/components/HelloWorld.vue | 111 +++++++++++----------------------- src/main.js | 24 +++++++- 4 files changed, 63 insertions(+), 79 deletions(-) diff --git a/index.html b/index.html index 030a6ff..af69107 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,9 @@ - Vite App + + + 打印
diff --git a/package.json b/package.json index 101d887..16e3215 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "guess": "^1.0.2", "vue": "^3.2.37", "jsbarcode": "^3.11.6", - "vue-html-to-paper":"^2.0.3" + "vue-html-to-paper":"^2.0.3", + "print-js":"^1.6.0" }, "devDependencies": { "@vitejs/plugin-vue": "^3.0.1", diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index eb0b61b..2975939 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -1,64 +1,9 @@ \ No newline at end of file diff --git a/src/main.js b/src/main.js index a250629..37c0642 100644 --- a/src/main.js +++ b/src/main.js @@ -5,4 +5,26 @@ import 'element-plus/dist/index.css' import './assets/main.css' -createApp(App).use(ElementPlus).mount('#app') +import VueHtmlToPaper from 'vue-html-to-paper'; + +const options = { + name: '_blank', + specs: [ + 'fullscreen=yes', + 'titlebar=yes', + 'scrollbars=yes' + ], + styles: [ + 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css', + 'https://unpkg.com/kidlat-css/css/kidlat.css' + ], + timeout: 100000, // default timeout before the print window appears + autoClose: false, // if false, the window will not close after printing + windowTitle: '打印', // override the window title +} + + +createApp(App) +.use(ElementPlus) +.use(VueHtmlToPaper, options) +.mount('#app') -- GitLab