From 69ed1555e7be98d643e5cf9c55b591c44d52d1b9 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 01 十一月 2024 11:24:24 +0800 Subject: [PATCH] 修改标签打印格式 --- src/components/tool/file-preview.vue | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/components/tool/file-preview.vue b/src/components/tool/file-preview.vue index 37705f8..d95afab 100644 --- a/src/components/tool/file-preview.vue +++ b/src/components/tool/file-preview.vue @@ -129,6 +129,7 @@ renderedHandler() { console.log("娓叉煋瀹屾垚") this.isDocShow = true + this.resetStyle() }, errorHandler() { console.log("娓叉煋澶辫触") @@ -196,6 +197,15 @@ } return result }, + resetStyle(){ + const elements = document.querySelectorAll('[style*="pt"]'); + for (const element of elements) { + const style = element.getAttribute('style'); + if (!!style) { + element.setAttribute('style', style.replace(/pt/g, 'px')); + } + } + } } } </script> -- Gitblit v1.9.3