瀏覽代碼

feat(report): 添加打印预览的外部样式表

yusheng 1 周之前
父節點
當前提交
88c9c4d808
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/views/inspectionReport/components/reportTemplateWrapper.vue

+ 3 - 1
src/views/inspectionReport/components/reportTemplateWrapper.vue

@@ -514,7 +514,9 @@
         const printWindow = window.open('', '_blank');
         printWindow.document.open();
         printWindow.document.write('<html><head><title>打印预览</title>');
-
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
         printWindow.document.write('</head><body>');
         printWindow.document.write(printSection.innerHTML);
         printWindow.document.write('</body></html>');