zhangjie před 2 roky
rodič
revize
f764e1c88b

+ 13 - 0
src/modules/paper-export/views/PaperTemplateBuild.vue

@@ -744,6 +744,19 @@ export default {
       }
     },
     getPreviewTemp() {
+      const elementDoms =
+        this.$refs.PaperTemplateView.$el.querySelectorAll(".elem-rich-text");
+      elementDoms.forEach((eDom) => {
+        const width = eDom.offsetWidth;
+        if (eDom.firstChild && eDom.firstChild.nodeName === "DIV") {
+          eDom.firstChild.style.width = width + "px";
+          if (
+            eDom.firstChild.firstChild &&
+            eDom.firstChild.firstChild.nodeName === "DIV"
+          )
+            eDom.firstChild.firstChild.style.width = width + "px";
+        }
+      });
       return previewTemp(this.$refs.PaperTemplateView.$el.outerHTML);
     },
     async toDownload() {